Commit Graph

35 Commits

Author SHA1 Message Date
yingrueil 8a5662b4a7 Add support for handling line break in document attribute 2020-01-20 14:34:14 +01:00
Alastair Daivis cf406e9640 Support 'swift_name' attributes on generated functions
Fixes #420
2020-01-12 16:18:17 +01:00
Emilio Cobos Álvarez 3639d6b23a Remove some dead code. 2020-01-07 21:46:57 +01:00
Alastair Daivis 9df58e7ecd Add support for the export_name function attribute 2020-01-07 21:44:17 +01:00
Bastien Orivel 25e51f6e3b Update syn related dependencies to 1.0 2019-08-19 09:28:03 +02:00
Delet0r 9197af7079 Fixed most of the clippy warnings (#378) 2019-08-15 10:23:37 +02:00
Bruno Kirschner 1450e39d8f Preserve indentation on comments.
As indentation is a very handy way to structure comments and increase
their readability as much of it as possible should be preserved.

This removes any trimming of leading white spaces and ensures that
any cbindgen annotations are still recognized afterwards.

... fixes #184
2019-08-08 14:07:04 +02:00
Bruno Kirschner 47e831753b Avoid trimming non whitespace characters.
Rustc already removes all leading `/` symbols during the conversion
from doc-comments into annotations. Any additional trimming of non
whitespace characters just reduces the formatting flexibility of a
comment.

... fixes #374
2019-08-08 14:07:04 +02:00
Bruno Kirschner b4b82a500c Preserve empty lines in doc comments.
This required two changes in parallel.

As a first and obvious step it removes a check that skipped emptys
lines during documentation loading, but it was also necessary to
refactore the `get_comment_lines()` utility method as a second step.

This second refactoring was necessary as each line in a doc comment
is trimmed and transformed in its own doc attribute. The attribute
of an empty line therefore contains an empty string as value. If we
now call `lines()` on such an empty string we end up with an empty
iterator as the method is internally configured to ignore trailing
empty lines.
2019-08-03 17:38:59 +02:00
Emilio Cobos Álvarez 7619be86bd ir: Add support for #[must_use]. (#307) 2019-03-27 00:47:21 +01:00
Emilio Cobos Álvarez 85aa989fd1 utilities: Fix Nightly warnings. 2019-01-18 23:28:31 +01:00
Ryan Hunt 9248f84d0c Move comment processing to a helper, and have it work with more comment types 2019-01-03 09:47:18 -06:00
Emilio Cobos Álvarez 094cd2bf5d Update syn.
Fixes #244
2018-12-29 14:25:50 +01:00
Vincent Esche 090b8154dd Implemented detection/omission of #[cfg(test)] and #[test] items 2018-08-28 16:11:23 -05:00
Ryan Hunt 52a187c2d1 Use rustfmt from nightly to match CI 2018-05-31 12:07:19 -05:00
Ryan Hunt e36f1854ca Update to mainline syn 0.14.1 2018-05-31 10:41:49 -05:00
Ryan Hunt 270491f439 Rustfmt 2018-01-31 23:32:16 -06:00
Ryan Hunt e336f80ff8 Update syn to 0.12.6 2018-01-31 23:28:20 -06:00
Ryan Hunt f0d6d67435 Rustfmt 2017-12-14 11:56:35 -06:00
Ryan Hunt 58d3178dc5 Format with rustfmt-nightly 2017-11-18 21:44:33 -05:00
Ryan Hunt e0ec983930 Don't skip #[no_mangle] fn's without extern "C"
The C ABI is the default for extern fn's.
2017-09-27 01:08:03 -04:00
Ryan Hunt 1f2d69947b Emit #ifdef's for #[cfg] attributes 2017-08-17 20:11:09 -04:00
Ryan Hunt b8a0bfe0ca Cleanup import statements 2017-08-12 01:53:11 -04:00
Ryan Hunt 9ca861d328 Cleanup path and generic path usage 2017-08-09 01:59:34 -04:00
Ryan Hunt 45cefbe80e Rename PathValue to Item 2017-08-07 20:17:34 -04:00
Georg Semmler 8793c227e4 Allow to translate doc comments
This adds an option to translate rust doc comments into documentation
comments in the generated c/c++ header
2017-08-03 03:50:34 -05:00
Ryan Hunt 6080032cf0 Move some things out of utilities 2017-07-25 00:47:31 -04:00
Ryan Hunt 3b64d8cee2 Split items.rs into ir/ 2017-07-25 00:37:22 -04:00
Ryan Hunt a957bc2787 Add source code licenses 2017-06-20 01:28:18 -04:00
Ryan Hunt 4064a09238 Do a bunch of clean up and add some comments 2017-06-20 01:25:42 -04:00
Ryan Hunt 0a891a5da0 Improve some error messages
Fixes #17
2017-06-19 22:43:20 -04:00
Ryan Hunt 52e90383d9 Handle PhantomData with any type parameter 2017-05-24 21:23:21 -04:00
Ryan Hunt 409755bc5a Use cdecl for formatting function declarations 2017-05-23 14:54:24 -04:00
Ryan Hunt b36cc69274 Improve support for zero sized types 2017-05-13 22:39:19 -04:00
Ryan Hunt 21b299e749 Rename syn_helpers to utilities 2017-05-13 20:33:18 -04:00