Expand description
AST surface that harn-lint consumes to enforce .harn.prompt
drift-prevention rules (#1669).
The template parser and AST are otherwise internal — exposing a shallow read-only view through this module keeps the lint crate free of template-engine internals while still giving rules enough structure to walk conditionals, sections, and includes.
Structs§
Enums§
- Condition
Shape - Coarse classification of an
{{ if expr }}condition. The lint rules don’t need to evaluate or fully reconstruct expressions — just enough structure to detect the two failure patterns called out in #1669: - Identity
Field - Lint
Construct - One lintable construct, materialized in source order so rules can reason about counts (e.g. branch-explosion) and individual call sites (e.g. provider-identity comparisons).
Functions§
- parse
- Parse a template source string into a flat list of lintable
constructs (conditionals + sections). Returns
Errwhen the template doesn’t parse — callers should surface the underlyingvalidate_template_syntaxerror to the user before linting.