From d951985665bf3e0248286a30c67c28f505eb27c9 Mon Sep 17 00:00:00 2001 From: Johnny Richard Date: Sun, 16 Apr 2023 03:29:02 +0200 Subject: Start using string_view on lexer and parser This change fixes the memory leak when token got created. Signed-off-by: Johnny Richard --- src/parser.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/parser.h') diff --git a/src/parser.h b/src/parser.h index e9a1cb7..d44a4df 100644 --- a/src/parser.h +++ b/src/parser.h @@ -18,6 +18,7 @@ #define PARSER_H #include "lexer.h" +#include "string_view.h" typedef struct parser_t { lexer_t *lexer; @@ -32,7 +33,7 @@ typedef struct ast_return_stmt_t { } ast_return_stmt_t; typedef struct ast_function_t { - char *name; + string_view_t name; type_t return_type; ast_return_stmt_t body; } ast_function_t; -- cgit v1.2.3