Mau.AST.Nodes (mau v0.8.0)

View Source

AST node helpers for the Mau template engine.

Provides functions to create AST nodes that follow the unified tuple format: {type, parts, opts}.

Summary

Functions

Creates an atom literal node for atom values.

Creates a binary operation node for binary operators.

Creates a function call node for function calls and filters.

Creates a comment node for template comments. Comments are not rendered in the final output.

Creates an expression node for variable interpolation.

Creates a literal node for constant values.

Creates a logical operation node for logical operators.

Creates a tag node for control flow and logic.

Creates a text node for raw text content.

Creates a unary operation node for unary operators like 'not'.

Creates a variable node for variable access.

Functions

atom_literal_node(atom_name, opts \\ [])

Creates an atom literal node for atom values.

binary_op_node(operator, left, right, opts \\ [])

Creates a binary operation node for binary operators.

call_node(function_name, args, opts \\ [])

Creates a function call node for function calls and filters.

comment_node(content, opts \\ [])

Creates a comment node for template comments. Comments are not rendered in the final output.

expression_node(expression_ast, opts \\ [])

Creates an expression node for variable interpolation.

literal_node(value, opts \\ [])

Creates a literal node for constant values.

logical_op_node(operator, left, right, opts \\ [])

Creates a logical operation node for logical operators.

tag_node(tag_type, parts, opts \\ [])

Creates a tag node for control flow and logic.

text_node(content, opts \\ [])

Creates a text node for raw text content.

unary_op_node(operator, operand, opts \\ [])

Creates a unary operation node for unary operators like 'not'.

variable_node(path, opts \\ [])

Creates a variable node for variable access.