Skip to main content

Module query_predicates

Module query_predicates 

Source
Expand description

Predicate evaluation for tree-sitter queries.

Tree-sitter compiles #match?, #eq?, etc. into QueryPredicate structs but does not evaluate them at match time — the caller is responsible for filtering matches that fail their predicates.

satisfies_predicates evaluates the standard tree-sitter predicates so that query authors can use them in .scm files and have them honoured at runtime.

Functions§

satisfies_predicates
Return true if all predicates on m’s pattern are satisfied, false otherwise.