diff options
| author | gingerBill <bill@gingerbill.org> | 2021-05-16 12:34:35 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-05-16 12:34:35 +0100 |
| commit | ce08e832f7dcdeeae37cf0e432648efa2f27f2a7 (patch) | |
| tree | 5fce8a8f71efe50d85831bd0c27cb344c2aee4ea /src/tokenizer.cpp | |
| parent | 24c89b3eeed9d36fd6adfdc2f4a412b39fc59c6b (diff) | |
Allow `..=` alongside `..` as a "full range" operator; Update `core:odin/parser` etc
Diffstat (limited to 'src/tokenizer.cpp')
| -rw-r--r-- | src/tokenizer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index 5936ac3fe..d1310b56e 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -76,6 +76,7 @@ TOKEN_KIND(Token__ComparisonEnd, ""), \ TOKEN_KIND(Token_Period, "."), \ TOKEN_KIND(Token_Comma, ","), \ TOKEN_KIND(Token_Ellipsis, ".."), \ + TOKEN_KIND(Token_RangeFull, "..="), \ TOKEN_KIND(Token_RangeHalf, "..<"), \ TOKEN_KIND(Token_BackSlash, "\\"), \ TOKEN_KIND(Token__OperatorEnd, ""), \ @@ -1204,6 +1205,9 @@ void tokenizer_get_token(Tokenizer *t, Token *token, int repeat=0) { if (t->curr_rune == '<') { advance_to_next_rune(t); token->kind = Token_RangeHalf; + } else if (t->curr_rune == '=') { + advance_to_next_rune(t); + token->kind = Token_RangeFull; } } else if ('0' <= t->curr_rune && t->curr_rune <= '9') { scan_number_to_token(t, token, true); |