summaryrefslogtreecommitdiff
path: root/src/lexer.h
diff options
context:
space:
mode:
authorJohnny Richard <johnny@johnnyrichard.com>2023-04-21 15:11:17 +0200
committerCarlos Maniero <carlosmaniero@gmail.com>2023-04-21 10:29:41 -0300
commitd86d70fc7c6751713a6b9f02d9f77814e2f75718 (patch)
tree15340e4f421628fa79461374c39407997f928d93 /src/lexer.h
parent562fa8785f9bc3074e8b2acf524f4120add22752 (diff)
parser: Parse integers arithmetic expression
This patch implements the AST creation for arithmetic expressions. NOTE: The implementation works only for integer numbers. Signed-off-by: Johnny Richard <johnny@johnnyrichard.com> Reviewed-by: Carlos Maniero <carlosmaniero@gmail.com>
Diffstat (limited to 'src/lexer.h')
-rw-r--r--src/lexer.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lexer.h b/src/lexer.h
index ae8ab60..9f45910 100644
--- a/src/lexer.h
+++ b/src/lexer.h
@@ -42,6 +42,7 @@ typedef struct token_t {
char *filepath;
uint32_t row;
uint32_t col;
+ uint32_t bol;
} token_t;
@@ -68,6 +69,8 @@ bool lexer_is_not_eof(lexer_t *lexer);
void lexer_drop_char(lexer_t *lexer);
+void lexer_step_back_to(lexer_t *lexer, token_t *token);
+
char * token_kind_to_str(token_kind_t kind);
#endif /* LEXER_H */