diff options
| author | gingerBill <bill@gingerbill.org> | 2025-02-22 17:56:42 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2025-02-22 17:56:42 +0000 |
| commit | 875dbf3140935d43bd996443fbe5bb05a5044395 (patch) | |
| tree | e673da78a6a1b3059c7e23c004f64f7b918934d9 /src/parser.cpp | |
| parent | 5bd43b94ec9bf70194ebe7c15bc51a93d135d51d (diff) | |
Disallow syntax: `proc(x,:T)`
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index 94f8fd42c..a3e95f451 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -4343,6 +4343,9 @@ gb_internal Ast *parse_field_list(AstFile *f, isize *name_count_, u32 allowed_fl if (f->curr_token.kind == Token_Colon) { + if (f->prev_token.kind == Token_Comma) { + syntax_error(f->prev_token, "Trailing comma before a colon is not allowed"); + } Array<Ast *> names = convert_to_ident_list(f, list, true, allow_poly_names); // Copy for semantic reasons if (names.count == 0) { syntax_error(f->curr_token, "Empty field declaration"); |