diff options
author | Johnny Richard <johnny@johnnyrichard.com> | 2023-04-16 03:29:02 +0200 |
---|---|---|
committer | Johnny Richard <johnny@johnnyrichard.com> | 2023-04-16 03:29:02 +0200 |
commit | d951985665bf3e0248286a30c67c28f505eb27c9 (patch) | |
tree | d8c77d73366d8a3eeb94f11163edc23201fff5c0 /src/parser.h | |
parent | d55938b34d6b7ee2c2d7da8483aaed5c8b9078a0 (diff) |
Start using string_view on lexer and parser
This change fixes the memory leak when token got created.
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
Diffstat (limited to 'src/parser.h')
-rw-r--r-- | src/parser.h | 3 |
1 files changed, 2 insertions, 1 deletions
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; |