lex_ctx of a return will be at the return keyword now

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-11-30 14:42:18 +01:00
parent 207293bf74
commit 535fd5744b

View file

@ -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;