]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Fixing lexer to not classify wrong tokens as operators
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 11 Nov 2012 17:57:02 +0000 (18:57 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 11 Nov 2012 17:57:02 +0000 (18:57 +0100)
lexer.c

diff --git a/lexer.c b/lexer.c
index 19d67207f5b0c04ccff0c8b0e2af9491e06a2717..a550ed0b2dd3bd4b92f27248e10ed9a434117b93 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -852,6 +852,7 @@ int lex_do(lex_file *lex)
     /* single-character tokens */
     switch (ch)
     {
+        case '[':
         case '(':
             if (!lex_tokench(lex, ch) ||
                 !lex_endtoken(lex))
@@ -866,14 +867,6 @@ int lex_do(lex_file *lex)
         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 '#':