Versions in this module Expand all Collapse all v1 v1.0.6 Apr 1, 2023 v1.0.5 Mar 30, 2023 v1.0.4 Nov 18, 2021 v1.0.3 Oct 8, 2020 v1.0.2 Feb 6, 2020 v1.0.1 Feb 5, 2020 v1.0.0 Mar 12, 2019 Changes in this version + const OpBinaryAdd + const OpBinaryAnd + const OpBinaryBitwiseAnd + const OpBinaryBitwiseOr + const OpBinaryBitwiseXor + const OpBinaryConcat + const OpBinaryDivide + const OpBinaryEndsWith + const OpBinaryEqual + const OpBinaryFloorDiv + const OpBinaryGreaterEqual + const OpBinaryGreaterThan + const OpBinaryIn + const OpBinaryIs + const OpBinaryIsNot + const OpBinaryLessEqual + const OpBinaryLessThan + const OpBinaryMatches + const OpBinaryModulo + const OpBinaryMultiply + const OpBinaryNotEqual + const OpBinaryNotIn + const OpBinaryOr + const OpBinaryPower + const OpBinaryRange + const OpBinaryStartsWith + const OpBinarySubtract + const OpUnaryNegative + const OpUnaryNot + const OpUnaryPositive + type ArrayExpr struct + Elements []Expr + func NewArrayExpr(pos Pos, els ...Expr) *ArrayExpr + func (exp *ArrayExpr) All() []Node + func (exp *ArrayExpr) String() string + type BinaryExpr struct + Left Expr + Op string + Right Expr + func NewBinaryExpr(left Expr, op string, right Expr, pos Pos) *BinaryExpr + func (exp *BinaryExpr) All() []Node + func (exp *BinaryExpr) String() string + type BlockNode struct + Body Node + Name string + Origin string + func NewBlockNode(name string, body Node, p Pos) *BlockNode + func (t *BlockNode) All() []Node + func (t *BlockNode) String() string + type BodyNode struct + Nodes []Node + func NewBodyNode(pos Pos, nodes ...Node) *BodyNode + func (l *BodyNode) All() []Node + func (l *BodyNode) Append(n Node) + func (l *BodyNode) String() string + type BoolExpr struct + Value bool + func NewBoolExpr(value bool, pos Pos) *BoolExpr + func (exp *BoolExpr) All() []Node + func (exp *BoolExpr) String() string + type CommentNode struct + func NewCommentNode(data string, p Pos) *CommentNode + type DebugError interface + Debug func() string + type DoNode struct + X Expr + func NewDoNode(expr Expr, pos Pos) *DoNode + func (t *DoNode) All() []Node + func (t *DoNode) String() string + type EmbedNode struct + Blocks map[string]*BlockNode + func NewEmbedNode(tmpl Expr, with Expr, only bool, blocks map[string]*BlockNode, pos Pos) *EmbedNode + func (t *EmbedNode) All() []Node + func (t *EmbedNode) String() string + type Expr interface + type ExtendsNode struct + Tpl Expr + func NewExtendsNode(tplRef Expr, p Pos) *ExtendsNode + func (t *ExtendsNode) All() []Node + func (t *ExtendsNode) String() string + type FilterExpr struct + func NewFilterExpr(name string, args []Expr, pos Pos) *FilterExpr + func (exp *FilterExpr) String() string + type FilterNode struct + Body Node + Filters []string + func NewFilterNode(filters []string, body Node, p Pos) *FilterNode + func (t *FilterNode) All() []Node + func (t *FilterNode) String() string + type ForNode struct + Body Node + Else Node + Key string + Val string + X Expr + func NewForNode(k, v string, expr Expr, body, els Node, p Pos) *ForNode + func (t *ForNode) All() []Node + func (t *ForNode) String() string + type FromNode struct + Imports map[string]string + Tpl Expr + func NewFromNode(tpl Expr, imports map[string]string, p Pos) *FromNode + func (t *FromNode) All() []Node + func (t *FromNode) String() string + type FuncExpr struct + Args []Expr + Name string + func NewFuncExpr(name string, args []Expr, pos Pos) *FuncExpr + func (exp *FuncExpr) All() []Node + func (exp *FuncExpr) String() string + type GetAttrExpr struct + Args []Expr + Attr Expr + Cont Expr + func NewGetAttrExpr(cont Expr, attr Expr, args []Expr, pos Pos) *GetAttrExpr + func (exp *GetAttrExpr) All() []Node + func (exp *GetAttrExpr) String() string + type GroupExpr struct + X Expr + func NewGroupExpr(inner Expr, pos Pos) *GroupExpr + func (exp *GroupExpr) All() []Node + func (exp *GroupExpr) String() string + type HashExpr struct + Elements []*KeyValueExpr + func NewHashExpr(pos Pos, elements ...*KeyValueExpr) *HashExpr + func (exp *HashExpr) All() []Node + func (exp *HashExpr) String() string + type IfNode struct + Body Node + Cond Expr + Else Node + func NewIfNode(cond Expr, body Node, els Node, p Pos) *IfNode + func (t *IfNode) All() []Node + func (t *IfNode) String() string + type ImportNode struct + Alias string + Tpl Expr + func NewImportNode(tpl Expr, alias string, p Pos) *ImportNode + func (t *ImportNode) All() []Node + func (t *ImportNode) String() string + type IncludeNode struct + Only bool + Tpl Expr + With Expr + func NewIncludeNode(tmpl Expr, with Expr, only bool, pos Pos) *IncludeNode + func (t *IncludeNode) All() []Node + func (t *IncludeNode) String() string + type KeyValueExpr struct + Key Expr + Value Expr + func NewKeyValueExpr(k, v Expr, pos Pos) *KeyValueExpr + func (exp *KeyValueExpr) All() []Node + func (exp *KeyValueExpr) String() string + type MacroNode struct + Args []string + Body *BodyNode + Name string + Origin string + func NewMacroNode(name string, args []string, body *BodyNode, p Pos) *MacroNode + func (t *MacroNode) All() []Node + func (t *MacroNode) String() string + type ModuleNode struct + Origin string + Parent *ExtendsNode + func NewModuleNode(name string, nodes ...Node) *ModuleNode + func (l *ModuleNode) String() string + type MultipleExtendsError struct + func (e *MultipleExtendsError) Error() string + type NameExpr struct + Name string + func NewNameExpr(name string, pos Pos) *NameExpr + func (exp *NameExpr) All() []Node + func (exp *NameExpr) String() string + type Node interface + All func() []Node + Start func() Pos + String func() string + type NodeVisitor interface + Enter func(Node) + Leave func(Node) + type NullExpr struct + func NewNullExpr(pos Pos) *NullExpr + func (exp *NullExpr) All() []Node + func (exp *NullExpr) String() string + type NumberExpr struct + Value string + func NewNumberExpr(val string, pos Pos) *NumberExpr + func (exp *NumberExpr) All() []Node + func (exp *NumberExpr) String() string + type ParsingError interface + Name func() string + Pos func() Pos + type Pos struct + Line int + Offset int + func (p Pos) Start() Pos + func (p Pos) String() string + type PrintNode struct + X Expr + func NewPrintNode(exp Expr, p Pos) *PrintNode + func (t *PrintNode) All() []Node + func (t *PrintNode) String() string + type SetNode struct + Name string + X Expr + func NewSetNode(varName string, expr Expr, pos Pos) *SetNode + func (t *SetNode) All() []Node + func (t *SetNode) String() string + type StringExpr struct + Text string + func NewStringExpr(text string, pos Pos) *StringExpr + func (exp *StringExpr) All() []Node + func (exp *StringExpr) String() string + type TernaryIfExpr struct + Cond Expr + FalseX Expr + TrueX Expr + func NewTernaryIfExpr(cond, tx, fx Expr, pos Pos) *TernaryIfExpr + func (exp *TernaryIfExpr) All() []Node + func (exp *TernaryIfExpr) String() string + type TestExpr struct + func NewTestExpr(name string, args []Expr, pos Pos) *TestExpr + func (exp *TestExpr) String() string + type TextNode struct + Data string + func NewTextNode(data string, p Pos) *TextNode + func (t *TextNode) All() []Node + func (t *TextNode) String() string + type Tree struct + Name string + Visitors []NodeVisitor + func NewNamedTree(name string, input io.Reader) *Tree + func NewTree(input io.Reader) *Tree + func Parse(input string) (*Tree, error) + func (t *Tree) Blocks() map[string]*BlockNode + func (t *Tree) Macros() map[string]*MacroNode + func (t *Tree) Parse() error + func (t *Tree) Root() *ModuleNode + type TrimmableNode struct + TrimAfter bool + TrimBefore bool + type UnaryExpr struct + Op string + X Expr + func NewUnaryExpr(op string, expr Expr, pos Pos) *UnaryExpr + func (exp *UnaryExpr) All() []Node + func (exp *UnaryExpr) String() string + type UnclosedTagError struct + func (e *UnclosedTagError) Error() string + type UnexpectedEOFError struct + func (e *UnexpectedEOFError) Error() string + type UnexpectedTokenError struct + func (e *UnexpectedTokenError) Error() string + type UnexpectedValueError struct + func (e *UnexpectedValueError) Error() string + type UseNode struct + Aliases map[string]string + Tpl Expr + func NewUseNode(tpl Expr, aliases map[string]string, pos Pos) *UseNode + func (t *UseNode) All() []Node + func (t *UseNode) String() string