Skip to content

JVM: leading \b before non-word alternation members (java .matches(, kotlin !is, scala !ptr) (Part of #7863) - #7864

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/7863-20261106T0435Z
Nov 6, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/7863-20261106T0435Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #7863 (siblings of #4108). Fixes the JVM-family members of the leading-\b class: an alternation member that starts with a non-word char behind a \b cannot match after whitespace or punctuation.

Checklist: done [c:6b972545]
Checklist: done [c:3c034a22]
Checklist: done [c:4d32b99d]

What changed

One read per site (line numbers in the issue had drifted; found by scan):

  • java.py regex_execution: \b(Pattern\.compile|Matcher\.find|\.matches\()\b. \b before \.matches only matched after a word char, and the trailing \b after ( needed a word char next, so "abc".matches("a.c"), f().matches(re) and a\n.matches(re) were all missed. Now \b(?:Pattern\.compile|Matcher\.find)\b|\.matches\(. Not a dash flag, so no (?<![\w-]): that would have broken s.matches(.
  • kotlin.py safety: !is behind \b never matched after a space. Moved to (?<![\w-])!is. Count-neutral: is already matched inside x !is T, and the new match consumes the same text, so it counts once (tested).
  • scala.py pointers: !ptr (Scala Native dereference) behind \b never matched. Moved to (?<![\w-])!ptr; the word-start members keep \b.

Class / Sibling gaps

Class: leading \b(...) before an alternation member starting with a non-word char. Members in this PR: java, kotlin, scala (above). Tests per input class in tests/extraction/languages/test_jvm_dash_flag_boundary_7863.py: after word char / quote / paren / whitespace, positive and negative, count-once.

Sibling gaps (not touched, different languages, own read each; issue #7863 checklist): agc_assembly.py:245, assembly.py:383, csharp.py:600, go.py:550, javascript.py:378, lua.py:289, ruby.py:308, swift.py:475, dart.py:170 and :386, dockerfile skipTests vs -DskipTests.
Remaining slices: none for the JVM family. Other languages as listed, grouped a few per PR.

Evidence

  • test_{java,kotlin,scala}_strict.py plus the new file: all pass.
  • golden-lock.sh crucible_check.py (both legs): PASS, zero drift, no bless needed.
  • ruff format clean on the 4 files. Not run: pr_gates --fast/--ratchets, full suite (CI's job; filler slice).

🤖 Generated with Claude Code

…kotlin !is, scala !ptr) (Part of #7863)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 6, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 6, 2026 04:45
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 6, 2026 04:46
@squid-shepherd

squid-shepherd Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant