Further refactoring done. The Parser runs without crashing, however it's output is still to be checked and verified.

This commit is contained in:
2022-03-02 21:24:58 +00:00
parent e20ccb8cfb
commit 221d575c16
6 changed files with 85 additions and 64 deletions
+8
View File
@@ -48,4 +48,12 @@ const char* GetLexemeMapping(TokenType type) {
}
return NULL;
}
void FreeToken(Token* token) {
if (!token) return;
if (token->type == String || token->type == Number || token->type == Identifier) free((void *) token->lexeme);
free(token);
}