diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-06-08 12:58:09 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-06-08 13:54:50 +0200 |
commit | ce6081dbbd588fb111754f3c2c1c93d2421c6ee6 (patch) | |
tree | 30d469066e6053128cc60dbae0b6160131d4518a /lexer.h | |
parent | a363e9c5e848ad21908b66d59433ab07dffbc7f1 (diff) |
lexer, vm: reorder token and instruction numbers
Ensure that relational operators in the lexer token and vm instruction
lists are both ordered in the same way according to the general operator
precedence of the grammar.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lexer.h')
-rw-r--r-- | lexer.h | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -29,17 +29,17 @@ typedef enum { TK_IF, TK_ELSE, TK_COMMA, - TK_ASBAND, - TK_ASBXOR, - TK_ASBOR, - TK_ASLEFT, - TK_ASRIGHT, + TK_ASSIGN, + TK_ASADD, + TK_ASSUB, TK_ASMUL, TK_ASDIV, TK_ASMOD, - TK_ASADD, - TK_ASSUB, - TK_ASSIGN, + TK_ASLEFT, + TK_ASRIGHT, + TK_ASBAND, + TK_ASBXOR, + TK_ASBOR, TK_QMARK, TK_COLON, TK_OR, @@ -47,10 +47,10 @@ typedef enum { TK_BOR, TK_BXOR, TK_BAND, - TK_EQ, - TK_NE, TK_EQS, TK_NES, + TK_EQ, + TK_NE, TK_LT, TK_LE, TK_GT, @@ -67,13 +67,15 @@ typedef enum { TK_COMPL, TK_INC, TK_DEC, - TK_LPAREN, + TK_DOT, TK_LBRACK, + TK_RBRACK, + TK_LPAREN, + TK_RPAREN, TK_TEXT, TK_LBRACE, TK_RBRACE, TK_SCOL, - TK_RPAREN, TK_ENDIF, TK_ELIF, TK_WHILE, @@ -94,8 +96,6 @@ typedef enum { TK_CONTINUE, TK_LOCAL, TK_ARROW, - TK_DOT, - TK_RBRACK, TK_TRUE, TK_FALSE, TK_NUMBER, |