diff options
Diffstat (limited to 'boot/lex.c')
| -rw-r--r-- | boot/lex.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/boot/lex.c b/boot/lex.c index f450798..82d3567 100644 --- a/boot/lex.c +++ b/boot/lex.c @@ -123,6 +123,7 @@ enum Token_Kind TOKEN_AMPERSAND, TOKEN_DOT, TOKEN_DOT_DOT, + TOKEN_DOT_DOT_DOT, TOKEN_BANG, TOKEN_QUESTION, TOKEN_PERCENT, @@ -244,6 +245,8 @@ token_kind_to_string(enum Token_Kind kind) return "DOT"; case TOKEN_DOT_DOT: return "DOT_DOT"; + case TOKEN_DOT_DOT_DOT: + return "DOT_DOT_DOT"; case TOKEN_BANG: return "BANG"; case TOKEN_QUESTION: @@ -618,10 +621,12 @@ lexer_symbol_token(struct Lexer* l, struct Lexer_Char current) if (a.got_match) RET{ TOKEN_ASSIGN_AMPERSAND, 2 }; RET{ TOKEN_AMPERSAND, 1 }; } - case '.': - a = lexer_match_char(l, '.'); + case '.': { + lexer_match_chars(l, '.', '.', &a, &b); + if (a.got_match && b.got_match) RET{ TOKEN_DOT_DOT_DOT, 3 }; if (a.got_match) RET{ TOKEN_DOT_DOT, 2 }; RET{ TOKEN_DOT, 1 }; + } case '!': { a = lexer_match_char(l, '='); if (a.got_match) RET{ TOKEN_NOT_EQUAL, 2 }; |
