From 967fb6e907a5fc14dac42c3d84faf7b494e1d6a5 Mon Sep 17 00:00:00 2001 From: ken Date: Fri, 21 Oct 2016 14:58:00 -0700 Subject: [PATCH] tokens now print their number if they are UNKNOWN --- src/bin/tools/testapc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bin/tools/testapc.c b/src/bin/tools/testapc.c index c51ba41..4db0b86 100644 --- a/src/bin/tools/testapc.c +++ b/src/bin/tools/testapc.c @@ -113,13 +113,20 @@ int test_yyparse TOK_CASE(CLOPEN,'i'); TOK_CASE(CLCLOSE,'i'); default: - tok_string = "UNKNOWN"; + tok_string = 0; tok_pattern[LOFFS] = 'i'; break; case 0: goto done; } - printf(tok_pattern, tok_string, yylval.val); + if (tok_string == NULL) + { tok_pattern[TOFFS] = 'i'; + printf(tok_pattern, tok, yylval.val); + } + else + { tok_pattern[TOFFS] = 's'; + printf(tok_pattern, tok_string, yylval.val); + } if (i % 4 == 0 || yylval.val == 0) printf(";\n"); } -- 2.18.0