]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.c
NOT for entity, function and string - we're not constant-folding it for functions...
[xonotic/gmqcc.git] / lexer.c
diff --git a/lexer.c b/lexer.c
index 6fc32b7c1456835bc059be907bba45468f6f980f..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 == '/') /* *=, /= */
        {
@@ -635,7 +638,6 @@ int lex_do(lex_file *lex)
                         !strcmp(v, "do")     ||
                         !strcmp(v, "if")     ||
                         !strcmp(v, "else")   ||
-                        !strcmp(v, "var")    ||
                         !strcmp(v, "local")  ||
                         !strcmp(v, "return") ||
                         !strcmp(v, "const"))