diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-10-08 18:09:08 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-10-08 18:09:08 -0400 |
| commit | e0f0e2aace9e819545388c46547188ee6296178b (patch) | |
| tree | 674a78c834c9d440e8f07da8a24bff76f35ecc71 /src/parser.cpp | |
| parent | f74c29b49a550e5e7029fde46de93068a9eecb46 (diff) | |
| download | zig-e0f0e2aace9e819545388c46547188ee6296178b.tar.gz zig-e0f0e2aace9e819545388c46547188ee6296178b.zip | |
generated docs: error sets in fn docs
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index 2aab416f20..9fcf233e2d 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -498,8 +498,12 @@ static AstNode *ast_parse_root(ParseContext *pc) { } static Token *ast_parse_doc_comments(ParseContext *pc, Buf *buf) { + Token *first_doc_token = nullptr; Token *doc_token = nullptr; while ((doc_token = eat_token_if(pc, TokenIdDocComment))) { + if (first_doc_token == nullptr) { + first_doc_token = doc_token; + } if (buf->list.length == 0) { buf_resize(buf, 0); } @@ -507,7 +511,7 @@ static Token *ast_parse_doc_comments(ParseContext *pc, Buf *buf) { buf_append_mem(buf, buf_ptr(pc->buf) + doc_token->start_pos + 3, doc_token->end_pos - doc_token->start_pos - 3); } - return doc_token; + return first_doc_token; } // ContainerMembers |
