mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
Parsing a comma as an operator now - unless noop is true
This commit is contained in:
parent
3618d071ff
commit
64c230d222
1 changed files with 10 additions and 2 deletions
12
lexer.c
12
lexer.c
|
@ -464,8 +464,6 @@ int lex_do(lex_file *lex)
|
||||||
case '[':
|
case '[':
|
||||||
case ']':
|
case ']':
|
||||||
|
|
||||||
case ',':
|
|
||||||
|
|
||||||
case '#':
|
case '#':
|
||||||
|
|
||||||
return (lex->tok->ttype = ch);
|
return (lex->tok->ttype = ch);
|
||||||
|
@ -491,12 +489,22 @@ int lex_do(lex_file *lex)
|
||||||
case '|':
|
case '|':
|
||||||
case '^':
|
case '^':
|
||||||
case '~':
|
case '~':
|
||||||
|
case ',':
|
||||||
return ch;
|
return ch;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ch == ',') {
|
||||||
|
if (!lex_tokench(lex, ch) ||
|
||||||
|
!lex_endtoken(lex))
|
||||||
|
{
|
||||||
|
return (lex->tok->ttype = TOKEN_FATAL);
|
||||||
|
}
|
||||||
|
return (lex->tok->ttype = TOKEN_OPERATOR);
|
||||||
|
}
|
||||||
|
|
||||||
if (ch == '+' || ch == '-' || /* ++, --, +=, -= and -> as well! */
|
if (ch == '+' || ch == '-' || /* ++, --, +=, -= and -> as well! */
|
||||||
ch == '>' || ch == '<' || /* <<, >>, <=, >= */
|
ch == '>' || ch == '<' || /* <<, >>, <=, >= */
|
||||||
ch == '=' || /* == */
|
ch == '=' || /* == */
|
||||||
|
|
Loading…
Reference in a new issue