tokens now print their number if they are UNKNOWN
authorken <ken@mihrtec.com>
Fri, 21 Oct 2016 21:58:00 +0000 (14:58 -0700)
committerken <ken@mihrtec.com>
Fri, 21 Oct 2016 21:58:00 +0000 (14:58 -0700)
src/bin/tools/testapc.c

index c51ba41..4db0b86 100644 (file)
@@ -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");
     }