From 66e278b0752eaa9808687c0dc214b49d7b58e8eb Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Sun, 15 Mar 2026 19:25:26 -0400 Subject: functional lexer --- lexer.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lexer.h') diff --git a/lexer.h b/lexer.h index 24fb22d..30848a8 100644 --- a/lexer.h +++ b/lexer.h @@ -2,8 +2,10 @@ #define LEXER_H enum token_type { + NOT_FOUND, IDENTIFIER, INT_LIT, + FLOAT_LIT, // TODO CHAR_LIT, STR_LIT, HASHTAG, @@ -52,13 +54,15 @@ enum token_type { SHL_EQ }; -typedef unsigned long long intlit_t; +typedef unsigned long long int_lit_t; +typedef double float_lit_t; struct token { enum token_type type; union { char* identifier; - intlit_t int_lit; + int_lit_t int_lit; + float_lit_t float_lit; char char_lit; char* str_lit; void* unused; @@ -66,6 +70,7 @@ struct token { }; void lexer_load(const char* path); +void lexer_close(); bool lexer_peek(struct token* p_token); bool lexer_pop(struct token* p_token); -- cgit v1.2.3