Upstream: ggml-org#27772
A final, non-lenient PEG parse incorrectly succeeds when until() reaches end-of-input without finding its delimiter.
Environment: current main 67672dc5b, Linux aarch64.
auto parser = build_peg_parser([](common_peg_parser_builder & p) {
return p.until("\"");
});
common_peg_parse_context ctx("no closing quote anywhere in here");
auto result = parser.parse(ctx);
Observed: result.success() is true; the added regression assertion expecting false fails. This can let a truncated Gemma 4 tool argument pass the final parse.
common_peg_until_parser::operator() returns NEED_MORE_INPUT at EOF only in lenient mode, then falls through to SUCCESS in final mode. The behavior dates to the PEG combinator introduction in 0a8026e768.
Upstream: ggml-org#27772
A final, non-lenient PEG parse incorrectly succeeds when
until()reaches end-of-input without finding its delimiter.Environment: current main
67672dc5b, Linux aarch64.Observed:
result.success()is true; the added regression assertion expecting false fails. This can let a truncated Gemma 4 tool argument pass the final parse.common_peg_until_parser::operator()returnsNEED_MORE_INPUTat EOF only in lenient mode, then falls through toSUCCESSin final mode. The behavior dates to the PEG combinator introduction in0a8026e768.