diff options
| author | gingerBill <bill@gingerbill.org> | 2019-05-28 12:45:20 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-05-28 12:45:20 +0100 |
| commit | 222941727f2b094449838135c3157120e0176e58 (patch) | |
| tree | 6e3051341f1873873596594abfe02693aad4e6fc /src/tokenizer.cpp | |
| parent | 5697d6df7466ef5f4e676f391c104ef165cadb6b (diff) | |
Add `..<` operator for ranges; Add extra checking for bit set assignments
Diffstat (limited to 'src/tokenizer.cpp')
| -rw-r--r-- | src/tokenizer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index e496165a0..dd9aa109c 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_RangeHalf, "..<"), \ TOKEN_KIND(Token_BackSlash, "\\"), \ TOKEN_KIND(Token__OperatorEnd, ""), \ \ @@ -985,6 +986,10 @@ Token tokenizer_get_token(Tokenizer *t) { if (t->curr_rune == '.') { // Could be an ellipsis advance_to_next_rune(t); token.kind = Token_Ellipsis; + if (t->curr_rune == '<') { + advance_to_next_rune(t); + token.kind = Token_RangeHalf; + } } else if ('0' <= t->curr_rune && t->curr_rune <= '9') { token = scan_number_to_token(t, true); } else { |