From 535fd5744b9a03fa8f2e8ee65976b173f125338c Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Fri, 30 Nov 2012 14:42:18 +0100 Subject: [PATCH] lex_ctx of a return will be at the return keyword now --- parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parser.c b/parser.c index 3fb9111..c13fb89 100644 --- a/parser.c +++ b/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; -- 2.39.2