diff options
Diffstat (limited to 'Token.h')
-rw-r--r-- | Token.h | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -1,7 +1,7 @@ #pragma once #include <stdbool.h> -enum { +typedef enum TokenType { TOK_NONE, TOK_WORD, TOK_STRING, @@ -18,8 +18,17 @@ enum { TOK_ASSIGN, TOK_COMMA, TOK_COMP_LESS, - TOK_MODULO, - TOK_MULT, + TOK_COMP_MORE, + TOK_ADD, + TOK_SUB, + TOK_MUL, + TOK_DIV, + TOK_MOD, + TOK_AND, + TOK_OR, + TOK_XOR, + TOK_REF, + TOK_NOT, /* double char toks */ TOK_COMMENT, TOK_COMP_EQ, @@ -35,7 +44,7 @@ enum { TOK_KW_IF, TOK_KW_ELSE, TOK_KW_WHILE, -}; +} TokenType; union TokenValue { char c; @@ -54,4 +63,4 @@ typedef struct Token { void token_free(Token *tok); void token_print(const Token *tok); -const char *token_type_str(const unsigned int type); +const char *token_type_str(TokenType type); |