From 33c8f0b84169370d4e1201f7937beffda00d5fed Mon Sep 17 00:00:00 2001 From: tocariimaa Date: Mon, 13 Jan 2025 14:38:25 -0300 Subject: [PATCH] lexer: use `Str_from_buf` here Instead of handcrafting the `Str` struct. --- compiler/lex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/lex.c b/compiler/lex.c index ec7aebc..a7b8eeb 100644 --- a/compiler/lex.c +++ b/compiler/lex.c @@ -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: