Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groovy parser parenthesis pt2 #4795

Closed
wants to merge 7 commits into from
Closed

Conversation

Laurens-W
Copy link
Contributor

What's changed?

Nested parentheses around method invocations are supported as well for the groovy parser.

What's your motivation?

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@Laurens-W Laurens-W added bug Something isn't working parser-groovy labels Dec 18, 2024
@Laurens-W Laurens-W self-assigned this Dec 18, 2024
int count = 0;
while (source.charAt(indexOfNextNonWhitespace(cursor, source)) == '(') {
openingParens.push(whitespace());
cursor++;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cursor++;
skip("(");

if (source.charAt(cursor) == '(') {
cursor++; // skip '('
return new J.TypeCast(randomId(), prefix, Markers.EMPTY,
if (!cast.isCoerce()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverse boolean expression

@timtebeek
Copy link
Contributor

@timtebeek timtebeek closed this Dec 19, 2024
@timtebeek timtebeek deleted the groovy-parser-parenthesis-pt2 branch December 19, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser-groovy
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants