From c8be9e8432f98ec8d146fda0d5ce02958a68ecc4 Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" <pesco@khjk.org> Date: Thu, 30 Mar 2023 15:47:59 +0000 Subject: [PATCH] comments regarding act_ks_value HParseResult was introduced in 6b54ebfa (generally parse stream objects) to hold the result of parsing the stream data, including the application of any filters. This is produced in act_ks_value(). The fact that parse errors in stream data are thus detectable is in fact significant for xref stream processing, so we should not just return the bare data on error. --- pdf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdf.c b/pdf.c index ed6afd0..144724b 100644 --- a/pdf.c +++ b/pdf.c @@ -383,7 +383,7 @@ Fontinfo_T *lookup_font(TextState_T *state, struct Env *aux); * custom token types */ HTokenType TT_XREntry, TT_Ref, TT_Dict, TT_Null; -HTokenType TT_HParseResult; // XXX what is this for?! +HTokenType TT_HParseResult; /* parsed stream data */ HTokenType TT_TextEntry, TT_ObjStm; typedef struct { @@ -3457,10 +3457,11 @@ p_take__m(HAllocator *mm__, size_t n, struct Env *aux) // Parser for object streams +// XXX move this back where it belongs (trawl git log) HParser *p_objstm__m(HAllocator *, const Dict *); // Action for stream continuation -HParsedToken *act_ks_value(const HParseResult *p, void *u); +// XXX move this back next to act_ks_value() where it belongs struct streamspec { Dict *dict; /* stream dictionary */ HParser *parser; /* data parser */ @@ -4532,7 +4533,6 @@ act_ks_value(const HParseResult *p, void *u) b.len = INT_MAX; log_message(7, "parse error in stream (type %*s)\n", (int)b.len, b.token); - // XXX return the undecoded stream (p->ast)? } return H_MAKE(HParseResult, res); } -- GitLab