Plombir::Template::Parser
Constants
MAX_NESTING = 100
Caps {% if %} / {% for %} nesting. Layouts nest a handful
of levels; past this the input is runaway, and failing here
keeps both the parser and the renderer's recursion shallow.
Class methods
An {% elsif %} opener: exactly elsif or elsif <name>.
Name validity is checked when the branch itself parses.
A dotted lookup name: title, post.title. Flat contexts
mean dots never traverse — the whole name is one key.
parse(tokens : Array(Lexer::Token), file : String = "<input>", lines : Array(String) = [] of String) : Array(AST::Node)
Parses tokens (from Lexer.tokenize) into a node list.
lines is the template split on \n, used for the source-line
footer in diagnostics.
source = "{% if x %}y{% end %}"
tokens = Lexer.tokenize(source)
Parser.parse(tokens, "page.html", source.split('\n')).size # => 1
A partial or component name: flat basenames only (header,
post-card, PostCard). No slashes or dots — partials live
beside the layouts that use them, components under
components/, so .. can never escape either directory.