]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.h
Fixing operator precedence of suffices
[xonotic/gmqcc.git] / lexer.h
diff --git a/lexer.h b/lexer.h
index 699099175e755e2290b29e3cc5addd69c8419d6d..f2933455723b0075e01ddf43c2c0619abc5ceb9b 100644 (file)
--- a/lexer.h
+++ b/lexer.h
@@ -139,9 +139,8 @@ typedef struct {
 static const oper_info c_operators[] = {
     { "(",   0, opid1('('),         ASSOC_LEFT,  99, OP_PREFIX}, /* paren expression - non function call */
 
-    { "++",  1, opid3('S','+','+'), ASSOC_LEFT,  16, OP_SUFFIX},
-    { "--",  1, opid3('S','-','-'), ASSOC_LEFT,  16, OP_SUFFIX},
-
+    { "++",  1, opid3('S','+','+'), ASSOC_LEFT,  15, OP_SUFFIX},
+    { "--",  1, opid3('S','-','-'), ASSOC_LEFT,  15, OP_SUFFIX},
     { ".",   2, opid1('.'),         ASSOC_LEFT,  15, 0 },
     { "(",   0, opid1('('),         ASSOC_LEFT,  15, 0 }, /* function call */
     { "[",   2, opid1('['),         ASSOC_LEFT,  15, 0 }, /* array subscript */
@@ -204,6 +203,8 @@ static const size_t c_operator_count = (sizeof(c_operators) / sizeof(c_operators
 static const oper_info fte_operators[] = {
     { "(",   0, opid1('('),         ASSOC_LEFT,  99, OP_PREFIX}, /* paren expression - non function call */
 
+    { "++",  1, opid3('S','+','+'), ASSOC_LEFT,  15, OP_SUFFIX},
+    { "--",  1, opid3('S','-','-'), ASSOC_LEFT,  15, OP_SUFFIX},
     { ".",   2, opid1('.'),         ASSOC_LEFT,  15, 0 },
     { "(",   0, opid1('('),         ASSOC_LEFT,  15, 0 }, /* function call */
     { "[",   2, opid1('['),         ASSOC_LEFT,  15, 0 }, /* array subscript */