mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-23 19:21:29 +00:00
var const / const var - both need to be allowed
This commit is contained in:
parent
d52879315d
commit
ac9d68387c
1 changed files with 7 additions and 0 deletions
7
parser.c
7
parser.c
|
@ -4175,6 +4175,13 @@ static bool parser_global_statement(parser_t *parser)
|
|||
parseerror(parser, "expected variable declaration after 'var'");
|
||||
return false;
|
||||
}
|
||||
if (parser->tok == TOKEN_IDENT && !strcmp(parser_tokval(parser), "const")) {
|
||||
(void)!parsewarning(parser, WARN_CONST_VAR, "ignoring `const` after 'var' qualifier");
|
||||
if (!parser_next(parser)) {
|
||||
parseerror(parser, "expected variable declaration after 'const var'");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return parse_variable(parser, NULL, true, CV_VAR, NULL);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue