Skip to main content

Module engine

Module engine 

Source
Expand description

Compile a Rule into a runnable matcher and run it against source.

The atomic tier supports three matcher forms, all reduced to a single RuleMatch stream:

  • pattern → compiled to a tree-sitter query via crate::pattern.
  • kind → the trivial query (<kind>) @__match.
  • regex → a text regex over the source, yielding spans with no AST metavar bindings.

Structs§

Binding
A metavariable binding: the captured text plus where it lives.
CompiledRule
A rule whose matcher has been compiled and is ready to run.
RuleMatch
One match of a rule against a file.
Span
A byte + row/col span. Rows/cols are 0-based, matching the rest of the Harn AST wire format.