From dc0a1189f074417e2759e119845ecbda4edbf4f1 Mon Sep 17 00:00:00 2001
From: "Sven M. Hallberg" <pesco@khjk.org>
Date: Sat, 8 Feb 2020 21:29:35 +0100
Subject: [PATCH] allow npair to no longer consume leading whitespace

---
 pdf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pdf.c b/pdf.c
index 895f7d0..5c2f49f 100644
--- a/pdf.c
+++ b/pdf.c
@@ -603,7 +603,7 @@ init_parser(struct Env *aux)
 
 	/* body */
 	H_RULE(indobj,	CHX(stream, obj));
-	H_RULE(objdef,	SEQ(npair, KW("obj"), ws, indobj, KW("endobj")));
+	H_RULE(objdef,	SEQ(ws, npair, KW("obj"), ws, indobj, KW("endobj")));
 	H_RULE(body,	h_many(objdef));
 
 	/* for object streams */
@@ -623,7 +623,7 @@ init_parser(struct Env *aux)
 
 	/* cross-reference streams */
 	H_RULE(xstream,	h_bind(stmbeg, kxstream, aux));
-	H_AVRULE(xrstm,	SEQ(npair, KW("obj"), ws, xstream));
+	H_AVRULE(xrstm,	SEQ(ws, npair, KW("obj"), ws, xstream));
 		// XXX skip however much we consumed and check for "endstream endobj"?
 
 	/* trailer */
-- 
GitLab