diff --git a/pdf.c b/pdf.c index 26dae6a97a171d5df31b6c910bc213c76073c3b8..3de0fea45a0f96b7a590dbc83591567088fcb514 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 */