Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #97 +/- ##
=========================================
- Coverage 83.8% 83.1% -0.7%
Complexity 1 1
=========================================
Files 134 134
Lines 41162 41223 +61
Branches 5522 5548 +26
=========================================
- Hits 34500 34288 -212
- Misses 4957 5217 +260
- Partials 1705 1718 +13
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0d29b2322
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| separatorMinLength = sepQuant.min; | ||
| separatorMaxLength = sepQuant.max; |
There was a problem hiding this comment.
Reject multi-character separator atoms before using bounds
When the separator quantifier wraps an atom that consumes more than one character, these fields are repetition counts, but generateSeparatorLengthCheck compares them to sepLen, the number of characters scanned. For example, (\w+)(?:--){2}\1 is still accepted by this detector because the first separator charset is -, but the generated matcher scans four hyphens and rejects it as 4 > max(2), so a valid input like ab----ab becomes a false negative. Either reject non-single-character separator atoms here or convert the bounds to character lengths before passing them to codegen.
Useful? React with 👍 / 👎.
Require group/backref pair to span the whole pattern, enforce group/separator length bounds in generated bytecode, and fix matchBounded to report absolute (not substring-relative) spans. Patterns with anchors outside the span now correctly fall through to VARIABLE_CAPTURE_BACKREF.
Tighten minCandidateLength to real group/separator bounds, fix stale javadoc examples and test labels, add mutation-killing detector tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds coverage for the non-capturing-group separator unwrap, lazy separator rejection, and nested-capturing-group rejections flagged as uncovered by codecov. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
generateSeparatorLengthCheck compares a scanned character count against
separatorMinLength/separatorMaxLength, but detectPinnedBackreference set
those from the raw quantifier repetition count (e.g. 2 for (?:--){2}
instead of 4 chars), rejecting valid matches like ab----ab.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
What does this PR do?
Fixes correctness bugs and remaining review findings in the PINNED_BACKREFERENCE strategy (a single-forward-scan matcher for backreference patterns like
(\w+)\s+\1where the group's charset is provably disjoint from what follows it):(?:\s+)) were silently treated as exactly-one-occurrence instead of honoring their real bounds.totalGroupCount(), causinggroup(n)to be inaccessible or throw.-1-buggy custommatchBounded/shiftSpansoverride in favor of the correct base-class default.minCandidateLength()to use the real group/separator minimum lengths instead of hardcoded values.||→&&and<1→<0on the span/separator-length checks).Motivation
Follow-up from the PINNED_BACKREFERENCE strategy review (PR #94) — a multi-stream code review surfaced a CRITICAL correctness bug and several HIGH/MEDIUM/LOW findings, all addressed here.
Related Issue(s)
Change Type
Checklist
./gradlew build)Performance Impact
minCandidateLength()now prunes more candidates before scanning (uses real group/separator minimum lengths instead of hardcoded 1s); no other performance-relevant change.Additional Notes
Both commits on this branch (PINNED_BACKREFERENCE fixes) were produced with AI assistance (Claude Code) and reviewed by me.