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
- Filter
Section - A filter section node
{{ filter name(param="value") }} content {{ endfilter }}
- Forloop
- A forloop: can be over values or key/values
- Function
Call - 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
- Logic
Expr - A logical expression
- Macro
Call - A call to a namespaced macro
macros::my_macro()
- Macro
Definition - A Macro definition
- Math
Expr - A mathematical expression
- Set
- Set a variable in the context
{% set val = "hey" %}
- String
Concat - 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.
- Logic
Operator - All logic operators
- Math
Operator - All math operators
- Node
- All Tera nodes that can be encountered