From 9b43d1d045023aa71b7fad780ae575501773aecc Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" <pesco@khjk.org> Date: Sat, 8 Feb 2020 21:41:22 +0100 Subject: [PATCH] put an explicit delimiter after all occurances of npair --- pdf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pdf.c b/pdf.c index 26dae6a..3de0fea 100644 --- a/pdf.c +++ b/pdf.c @@ -535,7 +535,7 @@ init_parser(struct Env *aux) * objects */ - H_ARULE(ref, SEQ(npair, KW("R"))); + H_ARULE(ref, SEQ(npair, wel,ws, KW("R"))); H_RULE(null, KW("null")); H_RULE(boole, CHX(TOK(LIT("true")), TOK(LIT("false")))); @@ -603,11 +603,11 @@ init_parser(struct Env *aux) /* body */ H_RULE(indobj, CHX(stream, obj)); - H_RULE(objdef, SEQ(ws, npair, KW("obj"), ws, indobj, KW("endobj"))); + H_RULE(objdef, SEQ(ws, npair, wel, KW("obj"), ws, indobj, KW("endobj"))); H_RULE(body, h_many(objdef)); /* for object streams */ - //H_RULE(osidx, MANY_WS(npair)); + //H_RULE(osidx, h_sepBy(npair, SEQ(wel,ws))); /* cross-reference section */ H_RULE(xreol, CHX(SEQ(sp, cr), SEQ(sp, lf), crlf)); @@ -623,7 +623,7 @@ init_parser(struct Env *aux) /* cross-reference streams */ H_RULE(xstream, h_bind(stmbeg, kxstream, aux)); - H_AVRULE(xrstm, SEQ(ws, npair, KW("obj"), ws, xstream)); + H_AVRULE(xrstm, SEQ(ws, npair, wel, KW("obj"), ws, xstream)); // XXX skip however much we consumed and check for "endstream endobj"? /* trailer */ -- GitLab