Make dump_title_value() still a little closer to dump_value().
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 7 Nov 2014 05:11:08 +0000 (21:11 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 7 Nov 2014 05:11:08 +0000 (21:11 -0800)
dump.c

diff --git a/dump.c b/dump.c
index 57bc9b4489e186abc35175038c40d53ed6031cc1..d9b92a4bb76b6d3ae15c51d389a8290573131f24 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -319,6 +319,7 @@ dump_value(int level)
               printf("variable %d has %d values:\n", i, y);
               for (int j = 0; j < y; j++)
                 {
+                  match_byte(0);
                   if (match_byte(3))
                     {
                       char *a = get_string();
@@ -328,14 +329,14 @@ dump_value(int level)
                       for (int k = 0; k <= level + 1; k++)
                         printf ("    ");
                       printf ("\"%s\", \"%s\", \"%s\"", a, b, c);
-                      match_byte(0);
-                      match_byte(0);
-                      match_byte(0);
-                      match_byte(0);
-                      match_byte(0);
                     }
                   else
                     dump_value (level+1);
+
+                  match_byte(0);
+                  match_byte(0);
+                  match_byte(0);
+                  match_byte(0);
                   putchar('\n');
                 }
             }