!quote, !unquote
[pspp] / src / language / lexer / token.c
index 454bd518684154ee7a6f8bbad6ac972e913d5fae..9fa5bbb6ba81804534c809f4a2b90bb552c607cf 100644 (file)
@@ -176,7 +176,7 @@ token_to_string (const struct token *token)
       return string_representation (token->string);
 
     default:
-      return xstrdup_if_nonnull (token_type_to_name (token->type));
+      return xstrdup_if_nonnull (token_type_to_string (token->type));
     }
 }
 
@@ -216,7 +216,7 @@ void
 tokens_uninit (struct tokens *tokens)
 {
   for (size_t i = 0; i < tokens->n; i++)
-    token_destroy (&tokens->tokens[i]);
+    token_uninit (&tokens->tokens[i]);
   free (tokens->tokens);
 }
 
@@ -229,3 +229,10 @@ tokens_add (struct tokens *tokens, const struct token *t)
 
   token_copy (&tokens->tokens[tokens->n++], t);
 }
+
+void
+tokens_print (const struct tokens *tokens, FILE *stream)
+{
+  for (size_t i = 0; i < tokens->n; i++)
+    token_print (&tokens->tokens[i], stream);
+}