Module ast

Source
Expand description

The AST of Tera

Structs§

Block
A block definition
Expr
An expression is a value that can be negated and followed by optional filters
FilterSection
A filter section node {{ filter name(param="value") }} content {{ endfilter }}
Forloop
A forloop: can be over values or key/values
FunctionCall
A function call, can be a filter or a global function
If
An if/elif/else condition with their respective body
In
Something that checks whether the left side is contained in the right side
LogicExpr
A logical expression
MacroCall
A call to a namespaced macro macros::my_macro()
MacroDefinition
A Macro definition
MathExpr
A mathematical expression
Set
Set a variable in the context {% set val = "hey" %}
StringConcat
Can only be a combination of string + ident or ident + ident
Test
A test node if my_var is odd
WS
Whether to remove the whitespace of a {% %} tag

Enums§

ExprVal
An expression is the node found in variable block, kwargs and conditions.
LogicOperator
All logic operators
MathOperator
All math operators
Node
All Tera nodes that can be encountered