summaryrefslogtreecommitdiff
path: root/src/lexer.h
diff options
context:
space:
mode:
authorCarlos Maniero <carlos@maniero.me>2023-05-02 23:45:50 -0300
committerJohnny Richard <johnny@johnnyrichard.com>2023-05-03 22:39:26 +0200
commit990f4d3e4c662c401a08e3704a39878fd6c1c1b6 (patch)
treeeb8e7469afafc6babae582304b8695611e179ad3 /src/lexer.h
parent77dbf3a5011566b4a6274b3cdfa075dd723642d3 (diff)
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 <carlos@maniero.me>
Diffstat (limited to 'src/lexer.h')
-rw-r--r--src/lexer.h1
1 files changed, 1 insertions, 0 deletions
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;