Skip to content

Groovy: fix return-type/control-flow/nested-paren bugs in args regex - #1026

Open
squid-protocol wants to merge 1 commit into
mainfrom
recovered-groovy-regex-fixes
Open

Groovy: fix return-type/control-flow/nested-paren bugs in args regex#1026
squid-protocol wants to merge 1 commit into
mainfrom
recovered-groovy-regex-fixes

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Recovered from an abandoned background-agent worktree -- never committed at the time. Three real bugs in the "args" pattern:

  • Lowercase primitive return types (void foo(), int add()) never matched since the return-type stepper required an uppercase first char. Added a primitive-keyword alternative alongside the existing capitalized-type branch, and allowed , so multi-param generic return types (Map<String, Integer> foo()) don't break after the first type param.
  • The flat [^)]* param-list matcher truncated at the first inner ), breaking on one-level-nested calls in default values (int y = Math.max(3, 4)). Swapped for a bounded one-level-nesting form.
  • No exclusion for control-flow keywords, so if (x) {, while (x) {, switch (x) {, for (i in ...) {, catch (Exception e) {, and synchronized(lock) { were all misread as method parameter blocks. Added the same negative-lookahead style func_start already uses.

Not yet verified against the golden-master corpus or opened as a PR -- needs the usual crucible_check.py pass before merging.

Description of Structural Changes

Visual Observatory Testing

  • I tested the output JSON on GitGalaxy.io OR the Airgap Observatory.
  • Flexbox constraints, HUD elements, and 3D rendering remain intact.

The Differential Scan Acknowledgement

  • I understand that my PR will be subjected to a Full Differential Scan.
  • I have provided the link to the specific repository this PR addresses so it can be tested alongside the 80-repo calibrated baseline.
  • I believe these changes will measurably improve the engine's Accuracy, Speed, Utility, or Ethos without causing regressions.

Recovered from an abandoned background-agent worktree -- never committed
at the time. Three real bugs in the "args" pattern:

- Lowercase primitive return types (void foo(), int add()) never matched
  since the return-type stepper required an uppercase first char. Added
  a primitive-keyword alternative alongside the existing capitalized-type
  branch, and allowed `,` so multi-param generic return types
  (Map<String, Integer> foo()) don't break after the first type param.
- The flat [^)]* param-list matcher truncated at the first inner `)`,
  breaking on one-level-nested calls in default values
  (int y = Math.max(3, 4)). Swapped for a bounded one-level-nesting form.
- No exclusion for control-flow keywords, so if (x) {, while (x) {,
  switch (x) {, for (i in ...) {, catch (Exception e) {, and
  synchronized(lock) { were all misread as method parameter blocks.
  Added the same negative-lookahead style func_start already uses.

Not yet verified against the golden-master corpus or opened as a PR --
needs the usual crucible_check.py pass before merging.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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