| ... | ... | @@ -903,8 +903,20 @@ pub fn parse(allocator: *mem.Allocator, source: []const u8) !ast.Tree { |
| 903 | 903 | State.ParamDeclEnd => |ctx| { |
| 904 | 904 | if (eatToken(&tok_it, &tree, Token.Id.Ellipsis3)) |ellipsis3| { |
| 905 | 905 | ctx.param_decl.var_args_token = ellipsis3; |
| 906 | | stack.append(State{ .ExpectToken = Token.Id.RParen }) catch unreachable; |
| 907 | | continue; |
| 906 | |
| 907 | switch (expectCommaOrEnd(&tok_it, &tree, Token.Id.RParen)) { |
| 908 | ExpectCommaOrEndResult.end_token => |t| { |
| 909 | if (t == null) { |
| 910 | stack.append(State{ .ExpectToken = Token.Id.RParen }) catch unreachable; |
| 911 | continue; |
| 912 | } |
| 913 | continue; |
| 914 | }, |
| 915 | ExpectCommaOrEndResult.parse_error => |e| { |
| 916 | try tree.errors.push(e); |
| 917 | return tree; |
| 918 | }, |
| 919 | } |
| 908 | 920 | } |
| 909 | 921 | |
| 910 | 922 | try stack.append(State{ .ParamDeclComma = ctx.fn_proto }); |