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

any-of fixes #326

Merged
merged 2 commits into from
Jan 8, 2025
Merged

any-of fixes #326

merged 2 commits into from
Jan 8, 2025

Conversation

amaanq
Copy link
Member

@amaanq amaanq commented Jan 8, 2025

Problem

In query initialization when creating predicates, the capture_id is never set for the any of predicate, leading to issues in cases where garbage data was used for the capture id, because the match would always fail then. Also, the logic for satisfying any-of predicates seems incorrect, it asserts that for all nodes, all values of the predicate must equal the node's text, which seems incorrect.

Solution

  • Set the capture id in query initialization
  • Have the logic of satisfies_anyof be "for all nodes, assert that any of the predicate values equal the node's text" (not all)

@amaanq amaanq merged commit 34422a2 into master Jan 8, 2025
12 checks passed
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.

Query doesn't always initialise properly, resulting in no results returned by capture
2 participants