diff options
Diffstat (limited to 'boot/lex.c')
| -rw-r--r-- | boot/lex.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/boot/lex.c b/boot/lex.c index e585e1a..6c3e86f 100644 --- a/boot/lex.c +++ b/boot/lex.c @@ -53,6 +53,7 @@ enum Token_Kind TOKEN_SQUARE_CLOSE, TOKEN_COMMA, + TOKEN_SEMICOLON, TOKEN_AMPERSAND, TOKEN_DOT, TOKEN_DOT_DOT, @@ -176,6 +177,8 @@ token_kind_to_string(enum Token_Kind kind) case TOKEN_COMMA: return "COMMA"; + case TOKEN_SEMICOLON: + return "SEMICOLON"; case TOKEN_AMPERSAND: return "AMPERSAND"; case TOKEN_DOT: @@ -331,7 +334,8 @@ token_is_empty(const struct Token* t) bool token_ends_statement(const struct Token* t) { - return token_is(t, TOKEN_END_OF_FILE) || token_is(t, TOKEN_NEWLINE); + return token_is(t, TOKEN_END_OF_FILE) || token_is(t, TOKEN_NEWLINE) + || token_is(t, TOKEN_SEMICOLON); } bool @@ -574,6 +578,8 @@ lexer_symbol_token(struct Lexer* l, struct Lexer_Char current) case ',': RET{ TOKEN_COMMA, 1 }; + case ';': + RET{ TOKEN_SEMICOLON, 1 }; case '&': { lexer_match_chars(l, '&', '=', &a, &b); |
