class

KrikriJinja::Parser

Inherits Reference < Object

Recursive-descent parser over the lexer's token stream.

Written against the Jinja2 Template Designer Documentation (the public spec of what templates must mean), not against any implementation.

Constructors

new(tokens : Array(Token))
Source

Class methods

parse(source : String, options : LexerOptions = LexerOptions.new) : Nodes::TemplateNode
Source
parse_expression(source : String, options : LexerOptions = LexerOptions.new) : Nodes::ExprNode
Source

Instance methods

advance
Source
current
Source
parse_expression
Source
parse_template
Source
parse_tuple_expression

Tuple expressions: a, b, c only meaningful where tuples are allowed.

Source
parse_tuple_no_cond

Like parse_tuple_expression but the items cannot be a if b else c conditional expressions (used by {% for %} so the loop if filter is not swallowed by the ternary grammar).

Source