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.
BindingMetadata
Semantic metadata for a Harn capture. Populated for Harn sources when the engine can resolve the captured node to a local declaration/binding or infer a simple static type.
CodemodResult
The result of applying a codemod rule’s fix to a source string.
CompiledRule
A rule whose matcher has been compiled and is ready to run.
Diagnostic
A diagnostic produced by running a rule — the mapping surface onto the linter’s LintDiagnostic / FixEdit (Epic C / the LSP reuse this).
ResolvedBinding
A resolved Harn declaration or binding identity.
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.