mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-25 04:31:25 +00:00
Fixing lexer to not classify wrong tokens as operators
This commit is contained in:
parent
511058c018
commit
22d6ff2309
1 changed files with 1 additions and 8 deletions
9
lexer.c
9
lexer.c
|
@ -852,6 +852,7 @@ int lex_do(lex_file *lex)
|
||||||
/* single-character tokens */
|
/* single-character tokens */
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
|
case '[':
|
||||||
case '(':
|
case '(':
|
||||||
if (!lex_tokench(lex, ch) ||
|
if (!lex_tokench(lex, ch) ||
|
||||||
!lex_endtoken(lex))
|
!lex_endtoken(lex))
|
||||||
|
@ -866,14 +867,6 @@ int lex_do(lex_file *lex)
|
||||||
case ';':
|
case ';':
|
||||||
case '{':
|
case '{':
|
||||||
case '}':
|
case '}':
|
||||||
case '[':
|
|
||||||
if (!lex_tokench(lex, ch) ||
|
|
||||||
!lex_endtoken(lex))
|
|
||||||
{
|
|
||||||
return (lex->tok.ttype = TOKEN_FATAL);
|
|
||||||
}
|
|
||||||
if (!lex->flags.noops)
|
|
||||||
return (lex->tok.ttype = TOKEN_OPERATOR);
|
|
||||||
case ']':
|
case ']':
|
||||||
|
|
||||||
case '#':
|
case '#':
|
||||||
|
|
Loading…
Reference in a new issue