-
Notifications
You must be signed in to change notification settings - Fork 90
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
Prepare for bindings PR, add Query.matches #159
Conversation
I'm really looking forward to the query matches API. Right now I have a mess of ugliness that tries organize the captures into matches in my code. One request would be to return a list of nodes for the match capture for patterns like ()* and ()+ that can match multiple nodes. So instead of matches() returning |
I created this PR to illustrate what I mean. I ended up storing the captures in a |
tree_sitter/binding.c
Outdated
Py_XDECREF(captures_for_match); | ||
goto error; | ||
} | ||
if (satisfies_text_predicates(self, _match, (Tree *)node->tree)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this check be moved outside of the capture loop to line 2011? The result of satisfies_text_predicates() should be the same the for all captures in the match so it could be checked just once per match.
92a8d3b
to
9b8fb19
Compare
52b2991
to
a074346
Compare
a3df35f
to
eb33be6
Compare
eb33be6
to
01c507e
Compare
Closes #108
Closes #151