diff options
Diffstat (limited to 'src/tokenizer.pry')
| -rw-r--r-- | src/tokenizer.pry | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tokenizer.pry b/src/tokenizer.pry index ddc2cef..c809420 100644 --- a/src/tokenizer.pry +++ b/src/tokenizer.pry @@ -18,6 +18,8 @@ let TOKEN_CONTINUE = 8; let TOKEN_ARROW = 9; let TOKEN_STRUCT = 10; let TOKEN_TYPE = 34; +let TOKEN_AND = 35; +let TOKEN_OR = 36; /* Identifiers */ let TOKEN_IDENTIFIER = 11; @@ -101,6 +103,12 @@ let print_tokens = (ts: *token, ts_len: i64) => i64 { if (to.type == TOKEN_TYPE) { printf("Type\n"); }; + if (to.type == TOKEN_AND) { + printf("And\n"); + }; + if (to.type == TOKEN_OR) { + printf("Or\n"); + }; if (to.type == TOKEN_IDENTIFIER) { printf("Identifier: %s\n", cast(*i8, to.data)); }; @@ -398,6 +406,14 @@ let tokenizer_next = (t: *tokenizer) => *token { (*to).type = TOKEN_TYPE; return to; }; + if tokenizer_accept_string(t, "and") { + (*to).type = TOKEN_AND; + return to; + }; + if tokenizer_accept_string(t, "or") { + (*to).type = TOKEN_OR; + return to; + }; if tokenizer_accept_string(t, "=>") { (*to).type = TOKEN_ARROW; |