diff options
Diffstat (limited to 'Token.c')
-rw-r--r-- | Token.c | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -4,21 +4,16 @@ void token_free(Token *tok) { - switch (tok->type) { - case TOK_WORD: - if (tok != NULL && tok->v.s != NULL) - free(tok->v.s); - default: - break; - } + if (tok != NULL && tok->s != NULL) + free(tok->s); } void token_print(const Token *tok) { printf("%u:%u\t", tok->line, tok->column); switch (tok->type) { - case TOK_WORD: printf("TOK_WORD %s\n", tok->v.s); break; - case TOK_STRING: printf("TOK_STRING \"%s\"\n", tok->v.s); break; + case TOK_WORD: printf("TOK_WORD %s\n", tok->s); break; + case TOK_STRING: printf("TOK_STRING \"%s\"\n", tok->s); break; case TOK_INTEGER: printf("TOK_INTEGER %d\n", tok->v.i); break; case TOK_PAREN_OPEN: printf("TOK_PAREN_OPEN\n"); break; case TOK_PAREN_CLOS: printf("TOK_PAREN_CLOS\n"); break; |