Make dump_dim_value() more like dump_value().
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 7 Nov 2014 05:15:09 +0000 (21:15 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 7 Nov 2014 05:15:09 +0000 (21:15 -0800)
dump.c

diff --git a/dump.c b/dump.c
index d9b92a4bb76b6d3ae15c51d389a8290573131f24..f436551fa5d578920e5d449132b61fa1c41c1edd 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -364,7 +364,7 @@ dump_dim_value(int level)
       match_byte_assert (0x58);
       printf ("variable \"%s\"", get_string());
       get_string();
-      if (!match_byte (2))
+      if (!match_byte (1) && !match_byte (2))
         match_byte_assert(3);
     }
   else if (match_byte (2))
@@ -380,8 +380,10 @@ dump_dim_value(int level)
       vallab = get_string ();
       printf ("value %g format %d(%d.%d) var \"%s\" vallab \"%s\"",
               value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
-      if (!match_u32 (3))
-        match_u32_assert (2);
+      if (!match_byte (1) && !match_byte (2))
+        match_byte_assert (3);
+      match_byte (0);
+      match_byte (0);
       match_byte (0);
     }
   else if (match_byte (1))
@@ -389,7 +391,7 @@ dump_dim_value(int level)
       unsigned int format;
       double value;
 
-      match_byte_assert (0x58);
+      dump_value_31 ();
       format = get_u32 ();
       value = get_double ();
       printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
@@ -397,11 +399,9 @@ dump_dim_value(int level)
       match_byte (0);
       match_byte (0);
       match_byte (0);
-      match_byte (1);
     }
   else
     {
-      match_byte (0);
       dump_value_31();
       printf ("; \"%s\", substitutions:", get_string());
       int total_subs = get_u32();