Groovy: fix return-type/control-flow/nested-paren bugs in args regex - #1026
Open
squid-protocol wants to merge 1 commit into
Open
Groovy: fix return-type/control-flow/nested-paren bugs in args regex#1026squid-protocol wants to merge 1 commit into
squid-protocol wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recovered from an abandoned background-agent worktree -- never committed at the time. Three real bugs in the "args" pattern:
,so multi-param generic return types (Map<String, Integer> foo()) don't break after the first type param.), breaking on one-level-nested calls in default values (int y = Math.max(3, 4)). Swapped for a bounded one-level-nesting form.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
The Differential Scan Acknowledgement