'var' is now no keyword anymore, :\

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-11-23 22:07:35 +01:00
parent 1c7e9c5fde
commit 2bc99076cf
2 changed files with 5 additions and 4 deletions

View file

@ -22,7 +22,6 @@ static size_t num_keywords_qc = sizeof(keywords_qc) / sizeof(keywords_qc[0]);
/* For fte/gmgqcc */
static const char *keywords_fg[] = {
"var",
"switch", "case", "default",
"struct", "union",
"break", "continue"

View file

@ -3712,9 +3712,8 @@ static bool parser_global_statement(parser_t *parser)
{
return parse_variable(parser, NULL, false, false);
}
else if (parser->tok == TOKEN_KEYWORD)
else if (parser->tok == TOKEN_IDENT && !strcmp(parser_tokval(parser), "var"))
{
/* handle 'var' and 'const' */
if (!strcmp(parser_tokval(parser), "var")) {
if (!parser_next(parser)) {
parseerror(parser, "expected variable declaration after 'var'");
@ -3722,7 +3721,10 @@ static bool parser_global_statement(parser_t *parser)
}
return parse_variable(parser, NULL, true, false);
}
else if (!strcmp(parser_tokval(parser), "const")) {
}
else if (parser->tok == TOKEN_KEYWORD)
{
if (!strcmp(parser_tokval(parser), "const")) {
if (!parser_next(parser)) {
parseerror(parser, "expected variable declaration after 'const'");
return false;