]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.h
gitignore: add gmqcc, gmqpak, qmcvm, testsuite, pak.
[xonotic/gmqcc.git] / lexer.h
diff --git a/lexer.h b/lexer.h
index 75fb83e9320fc159d432819c408b3abf339270c7..24ac39a63f7f574d1e9a8a7dfc1f8236cc51612a 100644 (file)
--- a/lexer.h
+++ b/lexer.h
@@ -76,6 +76,7 @@ enum {
 
     TOKEN_VA_ARGS, /* for the ftepp only */
     TOKEN_VA_ARGS_ARRAY, /* for the ftepp only */
+    TOKEN_VA_COUNT,     /* to get the count of vaargs */
 
     TOKEN_STRINGCONST, /* not the typename but an actual "string" */
     TOKEN_CHARCONST,
@@ -86,7 +87,11 @@ enum {
     TOKEN_WHITE,
     TOKEN_EOL,
 
-    TOKEN_EOF,
+    /* if we add additional tokens before this, the exposed API
+     * should not be broken anyway, but EOF/ERROR/... should
+     * still be at the bottom
+     */
+    TOKEN_EOF = 1024,
 
     /* We use '< TOKEN_ERROR', so TOKEN_FATAL must come after it and any
      * other error related tokens as well
@@ -165,18 +170,21 @@ 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,  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 */
+    { "++",  1, opid3('S','+','+'), ASSOC_LEFT,  17, OP_SUFFIX},
+    { "--",  1, opid3('S','-','-'), ASSOC_LEFT,  17, OP_SUFFIX},
+    { ".",   2, opid1('.'),         ASSOC_LEFT,  17, 0 },
+    { "(",   0, opid1('('),         ASSOC_LEFT,  17, 0 }, /* function call */
+    { "[",   2, opid1('['),         ASSOC_LEFT,  17, 0 }, /* array subscript */
+
+    { "++",  1, opid3('+','+','P'), ASSOC_RIGHT, 16, OP_PREFIX },
+    { "--",  1, opid3('-','-','P'), ASSOC_RIGHT, 16, OP_PREFIX },
+
+    { "**",  2, opid2('*', '*'),    ASSOC_RIGHT, 15, 0 },
 
     { "!",   1, opid2('!', 'P'),    ASSOC_RIGHT, 14, OP_PREFIX },
     { "~",   1, opid2('~', 'P'),    ASSOC_RIGHT, 14, OP_PREFIX },
     { "+",   1, opid2('+','P'),     ASSOC_RIGHT, 14, OP_PREFIX },
     { "-",   1, opid2('-','P'),     ASSOC_RIGHT, 14, OP_PREFIX },
-    { "++",  1, opid3('+','+','P'), ASSOC_RIGHT, 14, OP_PREFIX },
-    { "--",  1, opid3('-','-','P'), ASSOC_RIGHT, 14, OP_PREFIX },
 /*  { "&",   1, opid2('&','P'),     ASSOC_RIGHT, 14, OP_PREFIX }, */
 
     { "*",   2, opid1('*'),         ASSOC_LEFT,  13, 0 },
@@ -191,6 +199,7 @@ static const oper_info c_operators[] = {
 
     { "<",   2, opid1('<'),         ASSOC_LEFT,  10, 0 },
     { ">",   2, opid1('>'),         ASSOC_LEFT,  10, 0 },
+    { "<=>", 2, opid3('<','=','>'), ASSOC_LEFT,  10, 0 },
     { "<=",  2, opid2('<','='),     ASSOC_LEFT,  10, 0 },
     { ">=",  2, opid2('>','='),     ASSOC_LEFT,  10, 0 },