diff --git a/src/include/token.h b/src/include/token.h index 5628e2f0d..a91345865 100644 --- a/src/include/token.h +++ b/src/include/token.h @@ -9,11 +9,6 @@ token_T* token_init(const char* value, token_type_T type, lexer_T* lexer); char* token_to_string(const token_T* token); const char* token_type_to_string(token_type_T type); -char* token_value(const token_T* token); -int token_type(const token_T* token); - -size_t token_sizeof(void); - token_T* token_copy(token_T* token); void token_free(token_T* token); diff --git a/src/token.c b/src/token.c index b6ef42fe8..dd7b9a76f 100644 --- a/src/token.c +++ b/src/token.c @@ -9,12 +9,8 @@ #include #include -size_t token_sizeof(void) { - return sizeof(struct TOKEN_STRUCT); -} - token_T* token_init(const char* value, const token_type_T type, lexer_T* lexer) { - token_T* token = calloc(1, token_sizeof()); + token_T* token = calloc(1, sizeof(token_T)); if (type == TOKEN_NEWLINE) { lexer->current_line++; @@ -119,18 +115,10 @@ char* token_to_string(const token_T* token) { return string; } -char* token_value(const token_T* token) { - return token->value; -} - -int token_type(const token_T* token) { - return token->type; -} - token_T* token_copy(token_T* token) { if (!token) { return NULL; } - token_T* new_token = calloc(1, token_sizeof()); + token_T* new_token = calloc(1, sizeof(token_T)); if (!new_token) { return NULL; }