diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-03 09:42:37 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-03 09:42:37 +0100 |
| commit | 3a9f7e6c9e1f44385c1950edc6267af8eea56a7e (patch) | |
| tree | fbf7175fbaec5d9776d105a6488680c87a694a61 /src/voidc.cc | |
| parent | 7ff9d2586a666bd420b98eb9f8de130cf57cd59d (diff) | |
formatting of tokens
Diffstat (limited to 'src/voidc.cc')
| -rw-r--r-- | src/voidc.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/voidc.cc b/src/voidc.cc index bba510f..282663e 100644 --- a/src/voidc.cc +++ b/src/voidc.cc @@ -1,3 +1,4 @@ +#include <unistd.h> #include <cstdio> #include <cstdlib> @@ -12,7 +13,6 @@ static const char* SOURCE = R"( int main() { return EXIT_FAILURE; } - )"; static const char* SOURCE_FILE = "source.c"; @@ -32,8 +32,8 @@ int main() { Tokenizer tokenizer(&stack); Token token = {}; - while(tokenizer_next(&tokenizer, &token)) - fprintf(stdout, "Token(kind: %d, text: %.*s)\n", token.kind, (int)token.text.length, token.text.ptr); - - + while (tokenizer_next(&tokenizer, &token)) { + token_write(&token, stdout); + fprintf(stdout, "\n"); + } } |
