]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.c
Bitshifting operators <<, >>, and compound assignment versions now work in non-consta...
[xonotic/gmqcc.git] / lexer.c
diff --git a/lexer.c b/lexer.c
index d153459ebc8fe87318e05dcddbf35306b84edd97..bfdc720eca244a62bb786addbc4105ecdceae14e 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -1233,12 +1233,16 @@ int lex_do(lex_file *lex)
         ch == '~' || ch == '^'    /* ~=, ~, ^                        */
     )  {
         lex_tokench(lex, ch);
-
         nextch = lex_getch(lex);
-        if ((nextch == '=' && ch != '<') ||
-            (nextch == ch  && ch != '!') ||
-            (nextch == '<' && ch == '>')) {
+
+        if ((nextch == '=' && ch != '<') || (nextch == '<' && ch == '>'))
+            lex_tokench(lex, nextch);
+        else if (nextch == ch && ch != '!') {
             lex_tokench(lex, nextch);
+            if ((thirdch = lex_getch(lex)) == '=')
+                lex_tokench(lex, thirdch);
+            else
+                lex_ungetch(lex, thirdch);
         } else if (ch == '<' && nextch == '=') {
             lex_tokench(lex, nextch);
             if ((thirdch = lex_getch(lex)) == '>')