Skip to main content

Module evaluator

Module evaluator 

Source
Expand description

The relational + composite matching algebra (#2833).

A crate::model::RuleNode compiles to a [CompiledNode] tree, which the evaluator walks against a parsed source tree. A node matches a tree-sitter node iff its atomic leaf matches and every relational (inside / has / follows / precedes) and composite (all / any / not / matches) part holds — every set key is ANDed.

Candidates for the top rule are seeded cheaply (the atomic pattern query in one pass, or a kind/regex/whole-tree walk); each candidate is then checked in full. Relational sub-rules run their own atomic match rooted at the ancestor/descendant/sibling under test.

Structs§

CompiledRuleTree
A compiled rule tree: the top node plus the utility rules matches references.
EvalMatch
One node that matched the top rule, with its bindings.