diff options
author | Bad Diode <bd@badd10de.dev> | 2022-04-06 08:02:52 -0300 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2022-04-06 08:02:52 -0300 |
commit | 11df0f4556f526189234be216fa16a2fcb8c308b (patch) | |
tree | d9459ebf0b99ef1ecadf4101da147d60935e916f /src/lexer.c | |
parent | 77b309ba82d090094f5f753342c3aa401cbf657d (diff) | |
download | bdl-11df0f4556f526189234be216fa16a2fcb8c308b.tar.gz bdl-11df0f4556f526189234be216fa16a2fcb8c308b.zip |
Add parsing of if statements
Diffstat (limited to 'src/lexer.c')
-rw-r--r-- | src/lexer.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lexer.c b/src/lexer.c index 729ea14..b4dcaf5 100644 --- a/src/lexer.c +++ b/src/lexer.c | |||
@@ -29,6 +29,11 @@ static const char* token_str[] = { | |||
29 | [TOKEN_NOT] = "TOKEN_NOT", | 29 | [TOKEN_NOT] = "TOKEN_NOT", |
30 | [TOKEN_AND] = "TOKEN_AND", | 30 | [TOKEN_AND] = "TOKEN_AND", |
31 | [TOKEN_OR] = "TOKEN_OR", | 31 | [TOKEN_OR] = "TOKEN_OR", |
32 | [TOKEN_EQ] = "TOKEN_EQ", | ||
33 | [TOKEN_LT] = "TOKEN_LT", | ||
34 | [TOKEN_GT] = "TOKEN_GT", | ||
35 | [TOKEN_LE] = "TOKEN_LE", | ||
36 | [TOKEN_GE] = "TOKEN_GE", | ||
32 | [TOKEN_COLON] = "TOKEN_COLON", | 37 | [TOKEN_COLON] = "TOKEN_COLON", |
33 | [TOKEN_DOT] = "TOKEN_DOT", | 38 | [TOKEN_DOT] = "TOKEN_DOT", |
34 | [TOKEN_AT] = "TOKEN_AT", | 39 | [TOKEN_AT] = "TOKEN_AT", |
@@ -61,6 +66,11 @@ static const Keyword keywords[] = { | |||
61 | KEYWORD("not", TOKEN_NOT), | 66 | KEYWORD("not", TOKEN_NOT), |
62 | KEYWORD("and", TOKEN_AND), | 67 | KEYWORD("and", TOKEN_AND), |
63 | KEYWORD("or", TOKEN_OR), | 68 | KEYWORD("or", TOKEN_OR), |
69 | KEYWORD("=", TOKEN_EQ), | ||
70 | KEYWORD("<", TOKEN_LT), | ||
71 | KEYWORD(">", TOKEN_GT), | ||
72 | KEYWORD("<=", TOKEN_LE), | ||
73 | KEYWORD(">=", TOKEN_GE), | ||
64 | }; | 74 | }; |
65 | 75 | ||
66 | void | 76 | void |