Ah right, 'var' is not an actual keyword, support TOKEN_IDENT-var inside functions

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-11-25 22:26:28 +01:00
parent f1bbdb7d45
commit 42bd37a2e8

View file

@ -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')