Skip to content

Zero-width subrows match empty; accept {0}/{1} quantifiers - #5

Merged
shigarov merged 1 commit into
mainfrom
feature/zero-width-subrow
Aug 29, 2026
Merged

Zero-width subrows match empty; accept {0}/{1} quantifiers#5
shigarov merged 1 commit into
mainfrom
feature/zero-width-subrow

Conversation

@shigarov

Copy link
Copy Markdown
Contributor

Summary

  • A subrow {…} (or subtable) whose children all matched zero elements used to throw colEnd must be >= colStart mid-row and silently fail at the end of a row. It now matches the empty sequence like * in regex: tried at the end of the sequence too, never repeated by +/*/{n}, not materialized in the ITM.
  • Quantifier.exactly(n) accepts n >= 0 ({1} ≡ no quantifier, {0} ≡ empty match); an invalid {n} in RTL is an RtlCompileException with position instead of a raw IllegalArgumentException.
  • Conformance: semantic subrow_zero_width_{mid,tail,repeated,repeated_star}, quantifier_exactly_{one,zero}; negative quantifier_exactly_negative; positive quantifier_small_n. Docs + CHANGELOG [Unreleased].

Found in regtab-eval-on-atbench (reports/full-run.md §5).

Test plan

  • mvn test — 2191 tests, 0 failures (task corpus, conformance, unit)
  • existing conformance/positive/ pairs unchanged → 12 CONCAT tasks byte-identical
  • downstream subtitle stratum (26 cases): workaround pattern yields identical recordsets before/after

🤖 Generated with Claude Code

A subrow (or subtable) whose children all matched zero elements used to
throw "colEnd must be >= colStart" mid-row and silently fail at the end
of a row. It now matches the empty sequence like `*` in regex: tried at
the end of the sequence too, never repeated by +/*/{n}, and not
materialized in the ITM. Quantifier.exactly(n) accepts n >= 0; an
invalid {n} in RTL is an RtlCompileException with position.

Conformance: semantic subrow_zero_width_{mid,tail,repeated,repeated_star},
quantifier_exactly_{one,zero}; negative quantifier_exactly_negative;
positive quantifier_small_n.

Found in regtab-eval-on-atbench (reports/full-run.md §5).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@shigarov
shigarov merged commit c4346ee into main Aug 29, 2026
2 checks passed
@shigarov
shigarov deleted the feature/zero-width-subrow branch August 29, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant