lang: lex: fix push_token not setting lex_prev_token
This commit is contained in:
@@ -298,7 +298,8 @@ void ivy_lexer_destroy(struct ivy_lexer *lex)
|
|||||||
b_queue_iterator_begin(&lex->lex_queue, &it);
|
b_queue_iterator_begin(&lex->lex_queue, &it);
|
||||||
|
|
||||||
while (b_queue_iterator_is_valid(&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);
|
b_queue_iterator_erase(&it);
|
||||||
ivy_token_destroy(tok);
|
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)
|
static enum ivy_status push_token(struct ivy_lexer *lex, struct ivy_token *tok)
|
||||||
{
|
{
|
||||||
b_queue_push_back(&lex->lex_queue, &tok->t_entry);
|
b_queue_push_back(&lex->lex_queue, &tok->t_entry);
|
||||||
|
lex->lex_prev_token = tok->t_type;
|
||||||
return IVY_OK;
|
return IVY_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user