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

Add #match? predicate support #1

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nobodywasishere
Copy link
Member

Predicates need to be implemented manually by the bindings as part of using the query cursor. This is one (basic) implementation that works, but it would be ideal if there was a better approach we could take that would be more general and cleaner. Open to suggestions and feedback.

@nobodywasishere nobodywasishere force-pushed the nobody/predicate-support branch from 5bb9efe to 8500d96 Compare January 21, 2025 22:31
) : Bool
unsafe_steps = LibTreeSitter.ts_query_predicates_for_pattern(
query,
capture.capture_index,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is supposed to be pattern_index, not capture_index

This can and should be done in a cleaner way.
@nobodywasishere nobodywasishere force-pushed the nobody/predicate-support branch from 8500d96 to 4de4b2b Compare January 23, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants