mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 06:02:22 +00:00
Fix variable declarations in for-loop initializers
This commit is contained in:
parent
6fee3ec363
commit
114a1d3b14
1 changed files with 10 additions and 9 deletions
19
parser.c
19
parser.c
|
@ -2588,16 +2588,17 @@ static bool parse_for_go(parser_t *parser, ast_block *block, ast_expression **ou
|
|||
initexpr = parse_expression_leave(parser, false, false, false);
|
||||
if (!initexpr)
|
||||
goto onerr;
|
||||
}
|
||||
|
||||
/* move on to condition */
|
||||
if (parser->tok != ';') {
|
||||
parseerror(parser, "expected semicolon after for-loop initializer");
|
||||
goto onerr;
|
||||
}
|
||||
if (!parser_next(parser)) {
|
||||
parseerror(parser, "expected for-loop condition");
|
||||
goto onerr;
|
||||
/* move on to condition */
|
||||
if (parser->tok != ';') {
|
||||
parseerror(parser, "expected semicolon after for-loop initializer");
|
||||
goto onerr;
|
||||
}
|
||||
|
||||
if (!parser_next(parser)) {
|
||||
parseerror(parser, "expected for-loop condition");
|
||||
goto onerr;
|
||||
}
|
||||
}
|
||||
|
||||
/* parse the condition */
|
||||
|
|
Loading…
Reference in a new issue