Skip to content

Conversation

the-mikedavis
Copy link
Member

The (#match? @foo "^(bar|baz)$") predicate was a workaround necessary when #any-of? was not broadly supported. Now that it has been standard for a while, we can switch these uses of #match? to #any-of?.

https://tree-sitter.github.io/tree-sitter/using-parsers/queries/3-predicates-and-directives.html#the-any-of-predicate

The `(#match? @foo "^(bar|baz)$")` predicate was a workaround necessary
when `#any-of?` was not broadly supported. Now that it has been standard
for a while, we can switch these uses of `#match?` to `#any-of?`.
Copy link
Member

@jonatanklosko jonatanklosko left a comment

Choose a reason for hiding this comment

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

Looks great!

@the-mikedavis the-mikedavis merged commit 0e8eb7f into main Jan 24, 2025
1 check passed
@the-mikedavis the-mikedavis deleted the md-any-of branch January 24, 2025 16:20
williamthome added a commit to williamthome/tree-sitter-herl that referenced this pull request Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants