From b8e76aa1e888a4602d4220206bbea8d04882fae2 Mon Sep 17 00:00:00 2001 From: Carlos Maniero Date: Wed, 26 Apr 2023 01:57:40 -0300 Subject: lexer: Split operation tokens into their own token The +, -, *, and / tokens used to be TOKEN_OP, but the TOKEN_OP has been removed and a token for each operation has been introduced. Python's token names were followed: https://docs.python.org/3/library/token.html Signed-off-by: Carlos Maniero Reviewed-by: Johnny Richard --- src/lexer.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lexer.h') diff --git a/src/lexer.h b/src/lexer.h index 8c84745..d4e84e1 100644 --- a/src/lexer.h +++ b/src/lexer.h @@ -32,7 +32,11 @@ typedef enum TOKEN_OCURLY, TOKEN_CCURLY, TOKEN_NUMBER, - TOKEN_OP, + TOKEN_PLUS, + TOKEN_MINUS, + TOKEN_STAR, + TOKEN_SLASH, + TOKEN_EQUAL, TOKEN_EOF, TOKEN_UNKNOWN } token_kind_t; -- cgit v1.2.3