diff options
Diffstat (limited to 'src/bytecode/lexer.h')
-rw-r--r-- | src/bytecode/lexer.h | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/src/bytecode/lexer.h b/src/bytecode/lexer.h index e58dd05..a19ac11 100644 --- a/src/bytecode/lexer.h +++ b/src/bytecode/lexer.h | |||
@@ -3,18 +3,46 @@ | |||
3 | 3 | ||
4 | #include "string_view.h" | 4 | #include "string_view.h" |
5 | 5 | ||
6 | |||
7 | typedef enum TokenType { | 6 | typedef enum TokenType { |
8 | TOKEN_UNKNOWN = 0, | 7 | TOKEN_UNKNOWN = 0, |
8 | |||
9 | // Parentheses. | ||
9 | TOKEN_LPAREN, | 10 | TOKEN_LPAREN, |
10 | TOKEN_RPAREN, | 11 | TOKEN_RPAREN, |
11 | TOKEN_QUOTE, | 12 | |
12 | TOKEN_TRUE, | 13 | // Primitive types. |
13 | TOKEN_FALSE, | ||
14 | TOKEN_NIL, | ||
15 | TOKEN_FIXNUM, | 14 | TOKEN_FIXNUM, |
16 | TOKEN_SYMBOL, | 15 | TOKEN_SYMBOL, |
17 | TOKEN_STRING, | 16 | TOKEN_STRING, |
17 | |||
18 | // Keywords. | ||
19 | TOKEN_NIL, | ||
20 | TOKEN_QUOTE, | ||
21 | TOKEN_TRUE, | ||
22 | TOKEN_FALSE, | ||
23 | TOKEN_IF, | ||
24 | TOKEN_ELSE, | ||
25 | TOKEN_DEF, | ||
26 | TOKEN_FUN, | ||
27 | TOKEN_LAMBDA, | ||
28 | |||
29 | // Arithmetic. | ||
30 | TOKEN_ADD, | ||
31 | TOKEN_MIN, | ||
32 | TOKEN_MUL, | ||
33 | TOKEN_DIV, | ||
34 | TOKEN_MOD, | ||
35 | |||
36 | // Boolean comparisons. | ||
37 | TOKEN_NOT, | ||
38 | TOKEN_AND, | ||
39 | TOKEN_OR, | ||
40 | TOKEN_EQUAL, | ||
41 | TOKEN_LESS_THAN, | ||
42 | TOKEN_GREATER_THAN, | ||
43 | TOKEN_LESS_EQUAL_THAN, | ||
44 | TOKEN_GREATER_EQUAL_THAN, | ||
45 | |||
18 | TOKEN_EOF, | 46 | TOKEN_EOF, |
19 | } TokenType; | 47 | } TokenType; |
20 | 48 | ||