mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Fix parsing bug on bit_set[;x]
This commit is contained in:
@@ -2885,6 +2885,10 @@ gb_internal Ast *parse_operand(AstFile *f, bool lhs) {
|
|||||||
elem = parse_expr(f, true);
|
elem = parse_expr(f, true);
|
||||||
f->allow_range = prev_allow_range;
|
f->allow_range = prev_allow_range;
|
||||||
|
|
||||||
|
if (elem == nullptr) {
|
||||||
|
syntax_error(token, "Expected a type or range, got nothing");
|
||||||
|
}
|
||||||
|
|
||||||
if (allow_token(f, Token_Semicolon)) {
|
if (allow_token(f, Token_Semicolon)) {
|
||||||
underlying = parse_type(f);
|
underlying = parse_type(f);
|
||||||
} else if (allow_token(f, Token_Comma)) {
|
} else if (allow_token(f, Token_Comma)) {
|
||||||
@@ -2894,6 +2898,7 @@ gb_internal Ast *parse_operand(AstFile *f, bool lhs) {
|
|||||||
underlying = parse_type(f);
|
underlying = parse_type(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
expect_token(f, Token_CloseBracket);
|
expect_token(f, Token_CloseBracket);
|
||||||
return ast_bit_set_type(f, token, elem, underlying);
|
return ast_bit_set_type(f, token, elem, underlying);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user