From 42bd37a2e87458a3a12b6d614b5e28897d6abe1a Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sun, 25 Nov 2012 22:26:28 +0100 Subject: [PATCH] Ah right, 'var' is not an actual keyword, support TOKEN_IDENT-var inside functions --- parser.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/parser.c b/parser.c index 48b01a4..e8fddc9 100644 --- a/parser.c +++ b/parser.c @@ -2269,6 +2269,7 @@ static bool parse_goto(parser_t *parser, ast_expression **out) static bool parse_statement(parser_t *parser, ast_block *block, ast_expression **out, bool allow_cases) { + int cvq; ast_value *typevar = NULL; *out = NULL; @@ -2291,13 +2292,17 @@ static bool parse_statement(parser_t *parser, ast_block *block, ast_expression * *out = NULL; return true; } + else if (parser->tok == TOKEN_IDENT && !strcmp(parser_tokval(parser), "var")) + { + goto ident_var; + } else if (parser->tok == TOKEN_KEYWORD) { if (!strcmp(parser_tokval(parser), "local") || !strcmp(parser_tokval(parser), "const") || !strcmp(parser_tokval(parser), "var")) { - int cvq; +ident_var: if (parser_tokval(parser)[0] == 'c') cvq = CV_CONST; else if (parser_tokval(parser)[0] == 'v')