From 71ced998122c357bc62e54d9bb4e124c88acf94b Mon Sep 17 00:00:00 2001 From: nasr Date: Sun, 8 Mar 2026 21:01:43 +0000 Subject: refactor(main): worked on string handling in C and other stuff --- source/lexer.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 source/lexer.h (limited to 'source/lexer.h') diff --git a/source/lexer.h b/source/lexer.h new file mode 100644 index 0000000..7bafc0d --- /dev/null +++ b/source/lexer.h @@ -0,0 +1,32 @@ +#ifndef ENGINE_LEXER_H +#define ENGINE_LEXER_H + +typedef enum token_flags token_flags; +enum token_flags +{ + START_FL = 1 << 1, + END_FL = 1 << 2, +}; + + +typedef enum token_type token_type; +enum token_type +{ + // first 255 tokens for ascii characters + TOKEN_UNDEFINED = 255, + TOKEN_IDENTIFIER, + TOKEN_VALUE, + +}; + +typedef struct token token; +struct token +{ + string8 lexeme; + token_type type; + token_flags flags; +}; + + + +#endif /* ENGINE_LEXER_H */ -- cgit v1.3