From: ken Date: Fri, 21 Oct 2016 21:58:00 +0000 (-0700) Subject: tokens now print their number if they are UNKNOWN X-Git-Url: https://www.kengrimes.com/gitweb/?p=henge%2Fwebcc.git;a=commitdiff_plain;h=967fb6e907a5fc14dac42c3d84faf7b494e1d6a5 tokens now print their number if they are UNKNOWN --- 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"); }