commit c8be9e8432f98ec8d146fda0d5ce02958a68ecc4 from: Sven M. Hallberg date: Thu Mar 30 15:47:59 2023 UTC 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. commit - e61966396178de7c6118f47291cf1d93b96072d3 commit + c8be9e8432f98ec8d146fda0d5ce02958a68ecc4 blob - ed6afd0326403345282b893da4fea696848d9f41 blob + 144724bffd29935267b8fdcb759697f93218deee --- pdf.c +++ pdf.c @@ -383,7 +383,7 @@ Fontinfo_T *lookup_font(TextState_T *state, struct Env * 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); }