Updated the token to more reflect what was implemented in the book. Maybe not the right way to handle it but perhaps this setup will come in handy in later chapters.
This commit is contained in:
@@ -42,13 +42,14 @@ typedef struct {
|
||||
typedef struct {
|
||||
TokenType type;
|
||||
const char* lexeme;
|
||||
const void* literal;
|
||||
int line;
|
||||
} Token;
|
||||
|
||||
extern KeyValuePair TokenTypeMappings[TOKENTYPE_MAPPINGS_COUNT];
|
||||
|
||||
//If the first parameter is NULL, the token creation will attempt to infer the lexeme from the TokenType.
|
||||
Token* CreateToken(const char*, int, TokenType);
|
||||
Token* CreateToken(const char*, void*, int, TokenType);
|
||||
void FreeToken(Token*);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user