projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
!LENGTH and !BLANKS work
[pspp]
/
src
/
language
/
lexer
/
token.c
diff --git
a/src/language/lexer/token.c
b/src/language/lexer/token.c
index 454bd518684154ee7a6f8bbad6ac972e913d5fae..7becaaffad0ddbffdb5466f03293442eb2511ce7 100644
(file)
--- a/
src/language/lexer/token.c
+++ b/
src/language/lexer/token.c
@@
-176,7
+176,7
@@
token_to_string (const struct token *token)
return string_representation (token->string);
default:
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));
}
}
}
}
@@
-229,3
+229,10
@@
tokens_add (struct tokens *tokens, const struct token *t)
token_copy (&tokens->tokens[tokens->n++], 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);
+}