From: Wolfgang (Blub) Bumiller Date: Fri, 30 Nov 2012 23:32:18 +0000 (+0100) Subject: var const / const var - both need to be allowed X-Git-Tag: 0.1.9~151 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ac9d68387c633f1e5d2f02fd429a85cc089b6e83;p=xonotic%2Fgmqcc.git var const / const var - both need to be allowed --- diff --git a/parser.c b/parser.c index 6c126c6..01e3691 100644 --- a/parser.c +++ b/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); } }