lang: lex: fix push_token not setting lex_prev_token

This commit is contained in:
2024-11-27 12:56:39 +00:00
parent ad25b89af0
commit a5c0606221

View File

@@ -298,7 +298,8 @@ void ivy_lexer_destroy(struct ivy_lexer *lex)
b_queue_iterator_begin(&lex->lex_queue, &it);
while (b_queue_iterator_is_valid(&it)) {
struct ivy_token *tok = b_unbox(struct ivy_token, it.entry, t_entry);
struct ivy_token *tok
= b_unbox(struct ivy_token, it.entry, t_entry);
b_queue_iterator_erase(&it);
ivy_token_destroy(tok);
}
@@ -447,6 +448,7 @@ static struct ivy_token *create_token(enum ivy_token_type type)
static enum ivy_status push_token(struct ivy_lexer *lex, struct ivy_token *tok)
{
b_queue_push_back(&lex->lex_queue, &tok->t_entry);
lex->lex_prev_token = tok->t_type;
return IVY_OK;
}