diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2024-09-25 16:12:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-25 16:12:33 +0100 |
| commit | 987faa3f186a2929c27bcc856a0b2fae43a709e4 (patch) | |
| tree | 8d7fffe7b0dbe358f3f992e804a5fada8c0ece95 /src | |
| parent | e397fb6a7f272459546628cd6d9e1d229499f704 (diff) | |
| parent | 84700e09c9903e5e40badb829b599dd67886f68c (diff) | |
Merge pull request #4280 from Feoramund/fix-4278
Forbid parsing more fields if no separator was found
Diffstat (limited to 'src')
| -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 520a23c5a..5b4604c6d 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -4377,10 +4377,14 @@ gb_internal Ast *parse_field_list(AstFile *f, isize *name_count_, u32 allowed_fl } } - allow_field_separator(f); + bool more_fields = allow_field_separator(f); Ast *param = ast_field(f, names, type, default_value, set_flags, tag, docs, f->line_comment); array_add(¶ms, param); + if (!more_fields) { + if (name_count_) *name_count_ = total_name_count; + return ast_field_list(f, start_token, params); + } while (f->curr_token.kind != follow && f->curr_token.kind != Token_EOF && |