fix(lexer): lexing_mode depending on quote

This commit is contained in:
Matteo Flebus 2026-01-19 17:47:29 +01:00
parent bf7b7f7f68
commit ed4c3d475c

View file

@ -270,8 +270,13 @@ struct token *peek_token(void)
while (i < remaining_chars)
{
// true if we didn't encounter a quotes of any type at stream[i]
if (!update_lexing_mode(stream, i, &lexing_mode))
// true if encountered a quotes of any type at stream[i]
if (update_lexing_mode(stream, i, &lexing_mode))
{
i++;
continue;
}
else
{
if (is_special_char(stream[i]))
{
@ -309,8 +314,13 @@ struct token *pop_token(void)
while (i < remaining_chars)
{
// true if we didn't encounter a quotes of any type at stream[i]
if (!update_lexing_mode(stream, i, &lexing_mode))
// true if encountered a quotes of any type at stream[i]
if (update_lexing_mode(stream, i, &lexing_mode))
{
i++;
continue;
}
else
{
if (is_special_char(stream[i]))
{