mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-17 09:02:25 +00:00
parse_expression_leave: also end at a closing } - enum: check for } and , after an expression again
This commit is contained in:
parent
a468d0b478
commit
aa8b9eb1ad
1 changed files with 8 additions and 1 deletions
9
parser.c
9
parser.c
|
@ -1957,7 +1957,7 @@ static ast_expression* parse_expression_leave(parser_t *parser, bool stopatcomma
|
|||
goto onerr;
|
||||
}
|
||||
if (parser->tok == ';' ||
|
||||
(!parens && (parser->tok == ']' || parser->tok == ')')))
|
||||
(!parens && (parser->tok == ']' || parser->tok == ')' || parser->tok == '}')))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -3508,6 +3508,13 @@ static bool parse_enum(parser_t *parser)
|
|||
goto onerror;
|
||||
}
|
||||
num = (var->constval.vfloat = asvalue->constval.vfloat) + 1;
|
||||
|
||||
if (parser->tok == '}')
|
||||
break;
|
||||
if (parser->tok != ',') {
|
||||
parseerror(parser, "expected `}` or comma after expression");
|
||||
goto onerror;
|
||||
}
|
||||
}
|
||||
|
||||
if (parser->tok != '}') {
|
||||
|
|
Loading…
Reference in a new issue