summaryrefslogtreecommitdiff
path: root/lexer.h
diff options
context:
space:
mode:
Diffstat (limited to 'lexer.h')
-rw-r--r--lexer.h9
1 files changed, 7 insertions, 2 deletions
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);