]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
lex_ctx of a return will be at the return keyword now
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 13:42:18 +0000 (14:42 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 13:42:18 +0000 (14:42 +0100)
parser.c

index 3fb9111d768633d773ad9075194fbecedc0ae0f7..c13fb8927decb5e12b8602665f5a734f9e265aac 100644 (file)
--- 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;
 
     ast_return     *ret = NULL;
     ast_value      *expected = parser->function->vtype;
 
+    lex_ctx ctx = parser_ctx(parser);
+
     (void)block; /* not touching */
 
     if (!parser_next(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");
         }
             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;
     }
     *out = (ast_expression*)ret;
     return true;