mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Improve parsing for bit_field
This commit is contained in:
@@ -2607,6 +2607,14 @@ gb_internal Ast *parse_operand(AstFile *f, bool lhs) {
|
|||||||
CommentGroup *comment = nullptr;
|
CommentGroup *comment = nullptr;
|
||||||
|
|
||||||
Ast *name = parse_ident(f);
|
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);
|
expect_token(f, Token_Colon);
|
||||||
Ast *type = parse_type(f);
|
Ast *type = parse_type(f);
|
||||||
expect_token(f, Token_Or);
|
expect_token(f, Token_Or);
|
||||||
|
|||||||
Reference in New Issue
Block a user