diff options
author | Minijackson <minijackson@riseup.net> | 2020-02-23 20:38:42 +0100 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2020-02-23 20:38:42 +0100 |
commit | b0979e95bdc805cbe6c9e01ec05ed85d9d702167 (patch) | |
tree | 7a6cc0ffff6ab4c412aa5732a0ff3ed3d7d7209d | |
parent | ea2d20832ecf19b208fc7fd2ce315bd5502b03a2 (diff) | |
download | poseidoc-b0979e95bdc805cbe6c9e01ec05ed85d9d702167.tar.gz poseidoc-b0979e95bdc805cbe6c9e01ec05ed85d9d702167.zip |
clang-parser: allow nameless entities as it is common in C
for example:
typedef struct { ... } my_struct;
The struct is nameless, the typedef isn't.
For now this pattern is not detected, and renders badly in the generated
documentation. It stopped spouting errors for big C codebases, though.
-rw-r--r-- | src/parser/clang/entities.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/parser/clang/entities.rs b/src/parser/clang/entities.rs index f0acea6..e6ec296 100644 --- a/src/parser/clang/entities.rs +++ b/src/parser/clang/entities.rs | |||
@@ -63,8 +63,7 @@ impl<'a> TryFrom<clang::Entity<'a>> for Description { | |||
63 | fn try_from(entity: clang::Entity) -> Result<Self> { | 63 | fn try_from(entity: clang::Entity) -> Result<Self> { |
64 | let name = entity | 64 | let name = entity |
65 | .get_display_name() | 65 | .get_display_name() |
66 | // TODO: Properly define an error | 66 | .unwrap_or_default(); |
67 | .ok_or_else(|| anyhow!("Entity has no name"))?; | ||
68 | 67 | ||
69 | // TODO: is that the best? | 68 | // TODO: is that the best? |
70 | if let (Some(brief), Some(comment)) = (entity.get_comment_brief(), entity.get_comment()) { | 69 | if let (Some(brief), Some(comment)) = (entity.get_comment_brief(), entity.get_comment()) { |