mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-17 09:02:25 +00:00
lex_ctx of a return will be at the return keyword now
This commit is contained in:
parent
207293bf74
commit
535fd5744b
1 changed files with 3 additions and 1 deletions
4
parser.c
4
parser.c
|
@ -2046,6 +2046,8 @@ static bool parse_return(parser_t *parser, ast_block *block, ast_expression **ou
|
|||
ast_return *ret = NULL;
|
||||
ast_value *expected = parser->function->vtype;
|
||||
|
||||
lex_ctx ctx = parser_ctx(parser);
|
||||
|
||||
(void)block; /* not touching */
|
||||
|
||||
if (!parser_next(parser)) {
|
||||
|
@ -2076,7 +2078,7 @@ static bool parse_return(parser_t *parser, ast_block *block, ast_expression **ou
|
|||
else
|
||||
parseerror(parser, "return without value");
|
||||
}
|
||||
ret = ast_return_new(parser_ctx(parser), NULL);
|
||||
ret = ast_return_new(ctx, NULL);
|
||||
}
|
||||
*out = (ast_expression*)ret;
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue