]> git.saurik.com Git - bison.git/blobdiff - src/output.c
(goto_number): Now unsigned int, not short int.
[bison.git] / src / output.c
index 68dd2dffbd4575dae864d103135925d2086ce22d..a77546f1ff98f2da3741b8a98930b51aedbe5526 100644 (file)
@@ -402,16 +402,18 @@ symbol_destructors_output (FILE *out)
 
        /* Filename, lineno,
           Symbol-name, Symbol-number,
-          destructor, typename. */
+          destructor, optional typename.  */
        fprintf (out, "%s[", sep);
        sep = ",\n";
        escaped_file_name_output (out, sym->destructor_location.start.file);
-       fprintf (out, ", [[%d]], [[%s]], [[%d]], [[%s]], [[%s]]]",
+       fprintf (out, ", [[%d]], [[%s]], [[%d]], [[%s]]",
                 sym->destructor_location.start.line,
                 sym->tag,
                 sym->number,
-                sym->destructor,
-                sym->type_name);
+                sym->destructor);
+       if (sym->type_name)
+         fprintf (out, ", [[%s]]", sym->type_name);
+       fputc (']', out);
       }
   fputs ("])\n\n", out);
 }
@@ -435,16 +437,18 @@ symbol_printers_output (FILE *out)
 
        /* Filename, lineno,
           Symbol-name, Symbol-number,
-          printer, typename. */
+          printer, optional typename.  */
        fprintf (out, "%s[", sep);
        sep = ",\n";
        escaped_file_name_output (out, sym->printer_location.start.file);
-       fprintf (out, ", [[%d]], [[%s]], [[%d]], [[%s]], [[%s]]]",
+       fprintf (out, ", [[%d]], [[%s]], [[%d]], [[%s]]",
                 sym->printer_location.start.line,
                 sym->tag,
                 sym->number,
-                sym->printer,
-                sym->type_name);
+                sym->printer);
+       if (sym->type_name)
+         fprintf (out, ", [[%s]]", sym->type_name);
+       fputc (']', out);
       }
   fputs ("])\n\n", out);
 }
@@ -454,7 +458,7 @@ static void
 prepare_actions (void)
 {
   /* Figure out the actions for the specified state, indexed by
-     lookahead token type.  */
+     look-ahead token type.  */
 
   muscle_insert_rule_number_table ("defact", yydefact,
                                   yydefact[0], 1, nstates);