lexer: use Str_from_buf here

Instead of handcrafting the `Str` struct.
This commit is contained in:
tocariimaa 2025-01-13 14:38:25 -03:00
parent 0bedfa70c5
commit 33c8f0b841

View file

@ -286,7 +286,7 @@ string_literal(LexState *ls)
}
token.id = T_STRING;
token.str = (Str){str_buf, i};
token.str = Str_from_buf(str_buf, i);
token.len = i;
return token;
err: