diff options
| author | Vexu <15308111+Vexu@users.noreply.github.com> | 2019-11-15 15:03:28 +0200 |
|---|---|---|
| committer | Vexu <15308111+Vexu@users.noreply.github.com> | 2019-11-15 15:17:59 +0200 |
| commit | 977b6138817c4b09d6d1e47fa3562d9f9e0268a8 (patch) | |
| tree | 9279eb9d9029d0969f4253809e528cfa0b8898d6 /src/parser.cpp | |
| parent | e509d21f39af726da3c6001b0c20f2c765be07a5 (diff) | |
| download | zig-977b6138817c4b09d6d1e47fa3562d9f9e0268a8.tar.gz zig-977b6138817c4b09d6d1e47fa3562d9f9e0268a8.zip | |
add container doc comments to generated docs
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index eef832e32c..04dccb0d2a 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -493,7 +493,9 @@ static AstNode *ast_parse_root(ParseContext *pc) { node->data.container_decl.layout = ContainerLayoutAuto; node->data.container_decl.kind = ContainerKindStruct; node->data.container_decl.is_root = true; - node->data.container_decl.doc_comments = members.doc_comments; + if (buf_len(&members.doc_comments) != 0) { + node->data.container_decl.doc_comments = members.doc_comments; + } return node; } @@ -2817,7 +2819,9 @@ static AstNode *ast_parse_container_decl_auto(ParseContext *pc) { res->data.container_decl.fields = members.fields; res->data.container_decl.decls = members.decls; - res->data.container_decl.doc_comments = members.doc_comments; + if (buf_len(&members.doc_comments) != 0) { + res->data.container_decl.doc_comments = members.doc_comments; + } return res; } |
