static void
lex_source_pop__ (struct lex_source *src)
{
- token_destroy (&src->tokens[deque_pop_back (&src->deque)].token);
+ token_uninit (&src->tokens[deque_pop_back (&src->deque)].token);
}
static void
lex_source_pop_front (struct lex_source *src)
{
- token_destroy (&src->tokens[deque_pop_front (&src->deque)].token);
+ token_uninit (&src->tokens[deque_pop_front (&src->deque)].token);
}
/* Advances LEXER to the next token, consuming the current token. */
if (token.type != SCAN_SKIP)
{
bool match = lex_tokens_match (lex_next (lexer, i++), &token);
- token_destroy (&token);
+ token_uninit (&token);
if (!match)
return false;
}
/* Frees the string that TOKEN contains. */
void
-token_destroy (struct token *token)
+token_uninit (struct token *token)
{
if (token != NULL)
ss_dealloc (&token->string);
{ TYPE, NUMBER, SS_LITERAL_INITIALIZER (STRING) }
void token_init (struct token *);
-void token_destroy (struct token *);
+void token_uninit (struct token *);
char *token_to_string (const struct token *);