aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-02-22 20:10:38 +0000
committergingerBill <bill@gingerbill.org>2024-02-22 20:10:38 +0000
commita8909f06aea541860339c8c95f2bc8fe3f637a87 (patch)
treec0bd8e51a3fb68992df851c374230336fe56a3fd /src/parser.cpp
parent5c5b78cbbe6e9a3443448fd986f6068cfba9e136 (diff)
Improve parsing for `bit_field`
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 03d1e7aeb..14035d6d7 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -2607,6 +2607,14 @@ gb_internal Ast *parse_operand(AstFile *f, bool lhs) {
CommentGroup *comment = nullptr;
Ast *name = parse_ident(f);
+ bool err_once = false;
+ while (allow_token(f, Token_Comma)) {
+ Ast *dummy_name = parse_ident(f);
+ if (!err_once) {
+ error(dummy_name, "'bit_field' fields do not support multiple names per field");
+ err_once = true;
+ }
+ }
expect_token(f, Token_Colon);
Ast *type = parse_type(f);
expect_token(f, Token_Or);