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

Use pattern operator for all possible string kinds #4998

Merged
merged 6 commits into from
Feb 7, 2025

Conversation

jevanlingen
Copy link
Contributor

What's changed?

The pattern operator is supported for all possible string kinds.

What's your motivation?

The parser did only support the pattern operator for slashy strings (~/<pattern>/). Though by convention slashy strings are used most for the patten operator, you can use every kind of string:

The pattern operator (~) provides a simple way to create a java.util.regex.Pattern instance. While in general, you find the pattern operator with an expression in a slashy-string, it can be used with any kind of String in Groovy - docs

@jevanlingen jevanlingen requested a review from Laurens-W February 7, 2025 10:55
@jevanlingen jevanlingen self-assigned this Feb 7, 2025
@jevanlingen jevanlingen added bug Something isn't working parser-groovy labels Feb 7, 2025
Copy link
Contributor

@MBoegers MBoegers left a comment

Choose a reason for hiding this comment

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

Just quickly scanned, I have no big parser knowledge

@timtebeek timtebeek merged commit cb6f10c into main Feb 7, 2025
2 checks passed
@timtebeek timtebeek deleted the groovy-visitor-pattern-operator-all-strings branch February 7, 2025 14:25
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
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants