Plombir::Template::Errors
Builds Error diagnostics. Bodies stay stable — specs pin their
wording — while fail appends the source-line footer.
Constants
Filters the engine applies in {{ }}. Shared by the
unknown-filter diagnostic and its hint, like TAG_NAMES.
Names the engine understands in {% %}. Shared by the
unknown-tag diagnostic and its closest-name hint so the two
can never drift apart.
Class methods
The nearest candidate to word, or nil when nothing is near
enough: at most 3 edits and strictly fewer than the word's
length, so xyz never suggests end. Ties prefer the
longest shared prefix — typos usually keep the start of the
word, so endfor suggests end, not for.
Edit distance between two words (insert, delete, and substitute cost 1). Hand-rolled two-row table: tag and filter names are a few chars, so this is plenty and dependency-free.
Raises an Error for file at line:column, appending the
offending source line from lines (the template split on
\n) to body.
The offending source line, e.g. 12 │ {{ title }}. A missing
line (empty input) renders empty — never a crash.
A ready-to-print hint line for the nearest candidate, or nil. Generic over candidates so the future unknown-filter diagnostic reuses it unchanged.