mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
'var' is now no keyword anymore, :\
This commit is contained in:
parent
1c7e9c5fde
commit
2bc99076cf
2 changed files with 5 additions and 4 deletions
1
lexer.c
1
lexer.c
|
@ -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"
|
||||
|
|
8
parser.c
8
parser.c
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue