]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.c
lexer now turns '(' into an operator if noops=false
[xonotic/gmqcc.git] / lexer.c
diff --git a/lexer.c b/lexer.c
index 9bf460ac950041e140289455b6bc2beb8024295d..1adedc2ee5fcb14563857eba926cae87c05dcb8d 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -701,9 +701,18 @@ int lex_do(lex_file *lex)
        /* single-character tokens */
        switch (ch)
        {
-               case ';':
                case '(':
+               if (!lex_tokench(lex, ch) ||
+                   !lex_endtoken(lex))
+               {
+                   return (lex->tok->ttype = TOKEN_FATAL);
+               }
+               if (lex->flags.noops)
+                   return (lex->tok->ttype = ch);
+               else
+                   return (lex->tok->ttype = TOKEN_OPERATOR);
                case ')':
+               case ';':
                case '{':
                case '}':
                case '[':