fix: fix server crash related to parsing incomplete function as a function's parameter

fixes zigtools#567
This commit is contained in:
nullptrdevs
2022-08-25 13:17:38 -07:00
parent 8cf96fe27c
commit 54be6d92c6
6 changed files with 111 additions and 14 deletions

View File

@@ -462,7 +462,7 @@ fn writeNodeTokens(builder: *Builder, arena: *std.heap.ArenaAllocator, store: *D
try writeTokenMod(builder, fn_proto.name_token, func_name_tok_type, tok_mod);
var it = fn_proto.iterate(&tree);
while (it.next()) |param_decl| {
while (ast.nextFnParam(&it)) |param_decl| {
if (param_decl.first_doc_comment) |docs| try writeDocComments(builder, tree, docs);
try writeToken(builder, param_decl.comptime_noalias, .keyword);