Now the entire corpus (v1, v3, old, new) can be parsed through at least fonts.
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 27 Jul 2015 06:52:41 +0000 (23:52 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 27 Jul 2015 06:52:41 +0000 (23:52 -0700)
dump.c

diff --git a/dump.c b/dump.c
index bc3fe39388a26c6b65f103c655ac7320e949f618..45ae0d86534f2d6ff4b91a3378182b73d7598e73 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -724,12 +724,12 @@ dump_fonts(void)
       printf(" font=\"%s\"", get_string());
       match_byte_assert(0);
       match_byte_assert(0);
-      if (!match_byte(0x40) && !match_byte(0x20) && !match_byte(0x80) && !match_byte(0x10))
+      if (!match_byte(0x40) && !match_byte(0x20) && !match_byte(0x80) && !match_byte(0x10) && !match_byte(0x70))
         match_byte_assert(0x50);
       if (!match_byte(0x41))
         match_byte_assert(0x51);
-      if (!match_u32(0))
-        match_u32_assert(1);
+      if (!match_u32(0) && !match_u32(1))
+        match_u32_assert(2);
       match_byte_assert(0);
 
       /* OK, this seems really unlikely to be totally correct, but it matches my corpus... */
@@ -749,10 +749,12 @@ dump_fonts(void)
           /* These seem unlikely to be correct too. */
           if (i != 3)
             {
-              match_u32_assert(8);
-              if (!match_u32(10))
-                match_u32_assert(11);
-              match_u32_assert(1);
+              if (!match_u32(8))
+                match_u32_assert(5);
+              if (!match_u32(10) && !match_u32(11) && !match_u32(5))
+                match_u32_assert(9);
+              if (!match_u32(0))
+                match_u32_assert(1);
             }
           else
             {
@@ -780,6 +782,10 @@ dump_fonts(void)
     pos += 117;
   else if (match_u32(142))
     pos += 142;
+  else if (match_u32(143))
+    pos += 143;
+  else if (match_u32(150))
+    pos += 150;
   else
     {
       match_u32_assert(16);
@@ -809,17 +815,25 @@ dump_fonts(void)
   else
     match_u32_assert(UINT32_MAX);
   if (match_byte('.'))
-    match_byte_assert(',');
+    {
+      if (!match_byte(','))
+        match_byte_assert(' ');
+    }
   else
     {
       match_byte_assert(',');
-      if (!match_byte('.'))
-        match_byte_assert(' ');
+      if (!match_byte('.') && !match_byte(' '))
+        match_byte_assert(0);
     }
-  match_u32_assert(5);
-  for (int i = 0; i < 5; i++)
-    get_string();
-  pos += get_u32();
+  if (match_u32(5))
+    {
+      for (int i = 0; i < 5; i++)
+        get_string();
+    }
+  else
+    match_u32_assert(0);
+  int skip = get_u32();
+  pos += skip;
 }
 
 int