From d86d70fc7c6751713a6b9f02d9f77814e2f75718 Mon Sep 17 00:00:00 2001 From: Johnny Richard Date: Fri, 21 Apr 2023 15:11:17 +0200 Subject: 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 Reviewed-by: Carlos Maniero --- src/lexer.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lexer.h') 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 */ -- cgit v1.2.3