From 990f4d3e4c662c401a08e3704a39878fd6c1c1b6 Mon Sep 17 00:00:00 2001 From: Carlos Maniero Date: Tue, 2 May 2023 23:45:50 -0300 Subject: parser: Refactor return statement to return an ast_node During the refactoring process, I identified a memory leak where the return argument was allocated but not freed in case of an error. It also introduces the concept of keyword tokens. Where return is now a keyword simplifying the parser. Signed-off-by: Carlos Maniero --- src/lexer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lexer.h') diff --git a/src/lexer.h b/src/lexer.h index abee53a..70d4b0d 100644 --- a/src/lexer.h +++ b/src/lexer.h @@ -37,6 +37,7 @@ typedef enum TOKEN_STAR, TOKEN_SLASH, TOKEN_EQUAL, + TOKEN_KEYWORD_RETURN, TOKEN_EOF, TOKEN_UNKNOWN } token_kind_t; -- cgit v1.2.3