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);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1041,7 +1043,7 @@ struct ivy_token *ivy_lexer_read(struct ivy_lexer *lex)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
b_queue_entry *entry = b_queue_pop_front(&lex->lex_queue);
|
||||
struct ivy_token *tok = b_unbox(struct ivy_token, entry, t_entry);
|
||||
return tok;
|
||||
|
||||
Reference in New Issue
Block a user