]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
lexer: recognize != as operator when noops=false
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 16 Aug 2012 14:06:12 +0000 (16:06 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 16 Aug 2012 14:06:12 +0000 (16:06 +0200)
lexer.c

diff --git a/lexer.c b/lexer.c
index 0c58a5da64f27d69b5648d9076a14b1aba863b6b..382512de20cf71c4955802080cdceef53e7e76aa 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -528,6 +528,7 @@ int lex_do(lex_file *lex)
                        case '~':
                        case ',':
                    case '.':
+                   case '!':
                    if (!lex_tokench(lex, ch) ||
                        !lex_endtoken(lex))
                    {
@@ -550,7 +551,7 @@ int lex_do(lex_file *lex)
 
        if (ch == '+' || ch == '-' || /* ++, --, +=, -=  and -> as well! */
            ch == '>' || ch == '<' || /* <<, >>, <=, >= */
-           ch == '=' ||              /* == */
+           ch == '=' || ch == '!' || /* ==, != */
            ch == '&' || ch == '|')   /* &&, ||, &=, |= */
        {
                if (!lex_tokench(lex, ch))
@@ -571,6 +572,7 @@ int lex_do(lex_file *lex)
                return (lex->tok->ttype = TOKEN_OPERATOR);
        }
 
+    /*
        if (ch == '^' || ch == '~' || ch == '!')
        {
                if (!lex_tokench(lex, ch) ||
@@ -580,6 +582,7 @@ int lex_do(lex_file *lex)
                }
                return (lex->tok->ttype = TOKEN_OPERATOR);
        }
+       */
 
        if (ch == '*' || ch == '/') /* *=, /= */
        {