Documentation
¶
Index ¶
- func ReleaseAST(node Node)
- func ReleaseAttributeNode(n *AttributeNode)
- func ReleaseBinaryOpNode(n *BinaryOpNode)
- func ReleaseCallNode(n *CallNode)
- func ReleaseFilterNode(n *FilterNode)
- func ReleaseGetItemNode(n *GetItemNode)
- func ReleaseIdentifierNode(n *IdentifierNode)
- func ReleaseLiteralNode(n *LiteralNode)
- func ReleaseNode(node Node)
- func ReleaseUnaryOpNode(n *UnaryOpNode)
- type AssignmentNode
- type AttributeNode
- type AutoescapeNode
- type BaseNode
- type BinaryOpNode
- type BlockNode
- type BlockSetNode
- type BreakNode
- type CallBlockNode
- type CallNode
- type CommentNode
- type ComprehensionNode
- type ConditionalNode
- type ContinueNode
- type DoNode
- type ExpressionNode
- type ExtendsNode
- type ExtensionNode
- func (n *ExtensionNode) AddArgument(arg ExpressionNode)
- func (n *ExtensionNode) AddBodyNode(node Node)
- func (n *ExtensionNode) Column() int
- func (n *ExtensionNode) Evaluate(ctx interface{}) (interface{}, error)
- func (n *ExtensionNode) GetProperty(key string) (interface{}, bool)
- func (n *ExtensionNode) Line() int
- func (n *ExtensionNode) SetEvaluateFunc(fn func(*ExtensionNode, interface{}) (interface{}, error))
- func (n *ExtensionNode) SetProperty(key string, value interface{})
- func (n *ExtensionNode) StatementNode()
- func (n *ExtensionNode) String() string
- type FastEvaluator
- type FilterBlockNode
- type FilterNode
- type ForNode
- type FromNode
- type GetItemNode
- type IdentifierNode
- type IfNode
- type ImportNode
- type IncludeNode
- type ListNode
- type LiteralNode
- type MacroNode
- type Node
- type NodePoolStats
- type Parser
- func (p *Parser) Advance() *lexer.Token
- func (p *Parser) Check(tokenType lexer.TokenType) bool
- func (p *Parser) CheckAny(types ...lexer.TokenType) bool
- func (p *Parser) ErrorPublic(message string) error
- func (p *Parser) GetCurrentPosition() int
- func (p *Parser) GetErrors() []string
- func (p *Parser) GetTokens() []*lexer.Token
- func (p *Parser) IsAtEnd() bool
- func (p *Parser) Parse() (*TemplateNode, error)
- func (p *Parser) ParseBlockStatementPublic() (Node, error)
- func (p *Parser) ParseExpressionPublic() (ExpressionNode, error)
- func (p *Parser) ParseTopLevelPublic() (Node, error)
- func (p *Parser) Peek() *lexer.Token
- func (p *Parser) PeekBlockTypePublic() lexer.TokenType
- func (p *Parser) SetCurrentPosition(pos int)
- type RawNode
- type SetNode
- type SliceNode
- type StatementNode
- type SuperNode
- type TemplateNode
- type TestNode
- type TextNode
- type UnaryOpNode
- type VariableNode
- type WithNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReleaseAST ¶
func ReleaseAST(node Node)
ReleaseAST recursively releases all pooled nodes in an AST back to their pools. This should be called when a template is no longer needed to enable node reuse. Non-pooled node types are ignored and will be garbage collected normally.
func ReleaseAttributeNode ¶
func ReleaseAttributeNode(n *AttributeNode)
ReleaseAttributeNode returns an AttributeNode to the pool
func ReleaseBinaryOpNode ¶
func ReleaseBinaryOpNode(n *BinaryOpNode)
ReleaseBinaryOpNode returns a BinaryOpNode to the pool
func ReleaseCallNode ¶
func ReleaseCallNode(n *CallNode)
ReleaseCallNode returns a CallNode to the pool
func ReleaseFilterNode ¶
func ReleaseFilterNode(n *FilterNode)
ReleaseFilterNode returns a FilterNode to the pool
func ReleaseGetItemNode ¶
func ReleaseGetItemNode(n *GetItemNode)
ReleaseGetItemNode returns a GetItemNode to the pool
func ReleaseIdentifierNode ¶
func ReleaseIdentifierNode(n *IdentifierNode)
ReleaseIdentifierNode returns an IdentifierNode to the pool
func ReleaseLiteralNode ¶
func ReleaseLiteralNode(n *LiteralNode)
ReleaseLiteralNode returns a LiteralNode to the pool
func ReleaseNode ¶
func ReleaseNode(node Node)
ReleaseNode releases a node back to its appropriate pool. This is a convenience function that handles type dispatching. For complex ASTs, use ReleaseAST which recursively releases all nodes.
func ReleaseUnaryOpNode ¶
func ReleaseUnaryOpNode(n *UnaryOpNode)
ReleaseUnaryOpNode returns a UnaryOpNode to the pool
Types ¶
type AssignmentNode ¶
type AssignmentNode struct {
Target ExpressionNode // Can be identifier or attribute/item access
Value ExpressionNode
// contains filtered or unexported fields
}
AssignmentNode represents assignment expressions (set a = b)
func NewAssignmentNode ¶
func NewAssignmentNode(target, value ExpressionNode, line, column int) *AssignmentNode
func (*AssignmentNode) ExpressionNode ¶
func (n *AssignmentNode) ExpressionNode()
func (*AssignmentNode) String ¶
func (n *AssignmentNode) String() string
type AttributeNode ¶
type AttributeNode struct {
Object ExpressionNode
Attribute string
// contains filtered or unexported fields
}
AttributeNode represents attribute access (obj.attr)
func AcquireAttributeNode ¶
func AcquireAttributeNode(obj ExpressionNode, attr string, line, column int) *AttributeNode
AcquireAttributeNode gets an AttributeNode from the pool
func NewAttributeNode ¶
func NewAttributeNode(obj ExpressionNode, attr string, line, column int) *AttributeNode
func (*AttributeNode) ExpressionNode ¶
func (n *AttributeNode) ExpressionNode()
func (*AttributeNode) String ¶
func (n *AttributeNode) String() string
type AutoescapeNode ¶
type AutoescapeNode struct {
Enabled bool // true for autoescape on, false for off
Body []Node
// contains filtered or unexported fields
}
AutoescapeNode represents autoescape blocks {% autoescape true %}...{% endautoescape %}
func NewAutoescapeNode ¶
func NewAutoescapeNode(enabled bool, line, column int) *AutoescapeNode
func (*AutoescapeNode) StatementNode ¶
func (n *AutoescapeNode) StatementNode()
func (*AutoescapeNode) String ¶
func (n *AutoescapeNode) String() string
type BinaryOpNode ¶
type BinaryOpNode struct {
Left ExpressionNode
Operator string
Right ExpressionNode
// contains filtered or unexported fields
}
BinaryOpNode represents binary operations (a + b, a > b, etc.)
func AcquireBinaryOpNode ¶
func AcquireBinaryOpNode(left ExpressionNode, op string, right ExpressionNode, line, column int) *BinaryOpNode
AcquireBinaryOpNode gets a BinaryOpNode from the pool
func NewBinaryOpNode ¶
func NewBinaryOpNode(left ExpressionNode, op string, right ExpressionNode, line, column int) *BinaryOpNode
func (*BinaryOpNode) ExpressionNode ¶
func (n *BinaryOpNode) ExpressionNode()
func (*BinaryOpNode) String ¶
func (n *BinaryOpNode) String() string
type BlockNode ¶
BlockNode represents template blocks
func NewBlockNode ¶
func (*BlockNode) StatementNode ¶
func (n *BlockNode) StatementNode()
type BlockSetNode ¶
type BlockSetNode struct {
Variable string
Body []Node // The content between {% set var %} and {% endset %}
// contains filtered or unexported fields
}
BlockSetNode represents block assignment ({% set var %}content{% endset %})
func NewBlockSetNode ¶
func NewBlockSetNode(variable string, body []Node, line, column int) *BlockSetNode
func (*BlockSetNode) StatementNode ¶
func (n *BlockSetNode) StatementNode()
func (*BlockSetNode) String ¶
func (n *BlockSetNode) String() string
type BreakNode ¶
type BreakNode struct {
// contains filtered or unexported fields
}
BreakNode represents break statements in loops
func NewBreakNode ¶
func (*BreakNode) StatementNode ¶
func (n *BreakNode) StatementNode()
type CallBlockNode ¶
type CallBlockNode struct {
Call ExpressionNode // The function/macro call
Body []Node // The content between {% call %} and {% endcall %}
// contains filtered or unexported fields
}
CallBlockNode represents call blocks {% call macro_name() %}content{% endcall %}
func NewCallBlockNode ¶
func NewCallBlockNode(call ExpressionNode, body []Node, line, column int) *CallBlockNode
func (*CallBlockNode) StatementNode ¶
func (n *CallBlockNode) StatementNode()
func (*CallBlockNode) String ¶
func (n *CallBlockNode) String() string
type CallNode ¶
type CallNode struct {
Function ExpressionNode
Arguments []ExpressionNode
Keywords map[string]ExpressionNode
// contains filtered or unexported fields
}
CallNode represents function/macro calls
func AcquireCallNode ¶
func AcquireCallNode(function ExpressionNode, line, column int) *CallNode
AcquireCallNode gets a CallNode from the pool
func NewCallNode ¶
func NewCallNode(function ExpressionNode, line, column int) *CallNode
func (*CallNode) ExpressionNode ¶
func (n *CallNode) ExpressionNode()
type CommentNode ¶
type CommentNode struct {
Content string
// contains filtered or unexported fields
}
CommentNode represents template comments {# comment #}
func NewCommentNode ¶
func NewCommentNode(content string, line, column int) *CommentNode
func (*CommentNode) FastEval ¶
func (n *CommentNode) FastEval(e interface{}, ctx interface{}) (interface{}, error)
FastEval for CommentNode - returns empty string
func (*CommentNode) String ¶
func (n *CommentNode) String() string
type ComprehensionNode ¶
type ComprehensionNode struct {
Expression ExpressionNode
Variable string
Iterable ExpressionNode
Condition ExpressionNode // optional filter condition
IsDict bool // true for dict comprehensions
KeyExpr ExpressionNode // for dict comprehensions
// contains filtered or unexported fields
}
ComprehensionNode represents list/dict comprehensions
func NewComprehensionNode ¶
func NewComprehensionNode(expr ExpressionNode, variable string, iterable ExpressionNode, line, column int) *ComprehensionNode
func (*ComprehensionNode) ExpressionNode ¶
func (n *ComprehensionNode) ExpressionNode()
func (*ComprehensionNode) String ¶
func (n *ComprehensionNode) String() string
type ConditionalNode ¶
type ConditionalNode struct {
Condition ExpressionNode
TrueExpr ExpressionNode
FalseExpr ExpressionNode
// contains filtered or unexported fields
}
ConditionalNode represents ternary conditional expressions (condition ? true_expr : false_expr)
func NewConditionalNode ¶
func NewConditionalNode(condition, trueExpr, falseExpr ExpressionNode, line, column int) *ConditionalNode
func (*ConditionalNode) ExpressionNode ¶
func (n *ConditionalNode) ExpressionNode()
func (*ConditionalNode) String ¶
func (n *ConditionalNode) String() string
type ContinueNode ¶
type ContinueNode struct {
// contains filtered or unexported fields
}
ContinueNode represents continue statements in loops
func NewContinueNode ¶
func NewContinueNode(line, column int) *ContinueNode
func (*ContinueNode) StatementNode ¶
func (n *ContinueNode) StatementNode()
func (*ContinueNode) String ¶
func (n *ContinueNode) String() string
type DoNode ¶
type DoNode struct {
Expression ExpressionNode
// contains filtered or unexported fields
}
DoNode represents a do statement that executes an expression for side effects only
func NewDoNode ¶
func NewDoNode(expr ExpressionNode, line, column int) *DoNode
func (*DoNode) StatementNode ¶
func (n *DoNode) StatementNode()
type ExpressionNode ¶
type ExpressionNode interface {
Node
ExpressionNode()
}
ExpressionNode represents various expressions
type ExtendsNode ¶
type ExtendsNode struct {
Template ExpressionNode
// contains filtered or unexported fields
}
ExtendsNode represents template inheritance
func NewExtendsNode ¶
func NewExtendsNode(template ExpressionNode, line, column int) *ExtendsNode
func (*ExtendsNode) StatementNode ¶
func (n *ExtendsNode) StatementNode()
func (*ExtendsNode) String ¶
func (n *ExtendsNode) String() string
type ExtensionNode ¶
type ExtensionNode struct {
ExtensionName string
TagName string
Arguments []ExpressionNode
Body []Node
Properties map[string]interface{}
EvaluateFunc func(node *ExtensionNode, ctx interface{}) (interface{}, error)
// contains filtered or unexported fields
}
ExtensionNode represents a custom tag node in the AST
func NewExtensionNode ¶
func NewExtensionNode(extensionName, tagName string, line, column int) *ExtensionNode
func (*ExtensionNode) AddArgument ¶
func (n *ExtensionNode) AddArgument(arg ExpressionNode)
AddArgument adds an argument to the extension node
func (*ExtensionNode) AddBodyNode ¶
func (n *ExtensionNode) AddBodyNode(node Node)
AddBodyNode adds a node to the body
func (*ExtensionNode) Evaluate ¶
func (n *ExtensionNode) Evaluate(ctx interface{}) (interface{}, error)
Evaluate evaluates the extension node with the given context
func (*ExtensionNode) GetProperty ¶
func (n *ExtensionNode) GetProperty(key string) (interface{}, bool)
GetProperty gets a custom property
func (*ExtensionNode) SetEvaluateFunc ¶
func (n *ExtensionNode) SetEvaluateFunc(fn func(*ExtensionNode, interface{}) (interface{}, error))
SetEvaluateFunc sets the evaluation function
func (*ExtensionNode) SetProperty ¶
func (n *ExtensionNode) SetProperty(key string, value interface{})
SetProperty sets a custom property
func (*ExtensionNode) StatementNode ¶
func (n *ExtensionNode) StatementNode()
func (*ExtensionNode) String ¶
func (n *ExtensionNode) String() string
type FastEvaluator ¶
type FastEvaluator interface {
SetUndefinedBehavior(behavior interface{})
SetImportSystem(importSystem interface{})
}
FastEvalNode interface is defined in runtime package to avoid circular dependencies We use a local type alias here for convenience
type FilterBlockNode ¶
type FilterBlockNode struct {
FilterChain []FilterNode // Chain of filters to apply
Body []Node // Template content to filter
// contains filtered or unexported fields
}
FilterBlockNode represents filter blocks {% filter upper %}...{% endfilter %}
func NewFilterBlockNode ¶
func NewFilterBlockNode(filterChain []FilterNode, line, column int) *FilterBlockNode
func (*FilterBlockNode) StatementNode ¶
func (n *FilterBlockNode) StatementNode()
func (*FilterBlockNode) String ¶
func (n *FilterBlockNode) String() string
type FilterNode ¶
type FilterNode struct {
Expression ExpressionNode
FilterName string
Arguments []ExpressionNode
NamedArgs map[string]ExpressionNode
// contains filtered or unexported fields
}
FilterNode represents filter application (value|filter)
func AcquireFilterNode ¶
func AcquireFilterNode(expr ExpressionNode, filterName string, args []ExpressionNode, line, column int) *FilterNode
AcquireFilterNode gets a FilterNode from the pool
func NewFilterNode ¶
func NewFilterNode(expr ExpressionNode, filterName string, args []ExpressionNode, line, column int) *FilterNode
func (*FilterNode) ExpressionNode ¶
func (n *FilterNode) ExpressionNode()
func (*FilterNode) String ¶
func (n *FilterNode) String() string
type ForNode ¶
type ForNode struct {
Variables []string // Support multiple variables for unpacking
Iterable ExpressionNode
Condition ExpressionNode // Optional conditional for filtered iteration
Body []Node
Else []Node
Recursive bool
// contains filtered or unexported fields
}
ForNode represents for loops
func NewForNode ¶
func NewForNode(variables []string, iterable ExpressionNode, line, column int) *ForNode
func NewSingleForNode ¶
func NewSingleForNode(variable string, iterable ExpressionNode, line, column int) *ForNode
NewSingleForNode creates a for node with a single variable (backward compatibility)
func (*ForNode) StatementNode ¶
func (n *ForNode) StatementNode()
type FromNode ¶
type FromNode struct {
Template ExpressionNode // The template to import from
Names []string // The names to import
Aliases map[string]string // Optional aliases for imported names (name -> alias)
// contains filtered or unexported fields
}
FromNode represents from-import statements ({% from 'template.html' import item1, item2 %})
func NewFromNode ¶
func (*FromNode) StatementNode ¶
func (n *FromNode) StatementNode()
type GetItemNode ¶
type GetItemNode struct {
Object ExpressionNode
Key ExpressionNode
// contains filtered or unexported fields
}
GetItemNode represents item access (obj[key])
func AcquireGetItemNode ¶
func AcquireGetItemNode(obj, key ExpressionNode, line, column int) *GetItemNode
AcquireGetItemNode gets a GetItemNode from the pool
func NewGetItemNode ¶
func NewGetItemNode(obj, key ExpressionNode, line, column int) *GetItemNode
func (*GetItemNode) ExpressionNode ¶
func (n *GetItemNode) ExpressionNode()
func (*GetItemNode) String ¶
func (n *GetItemNode) String() string
type IdentifierNode ¶
type IdentifierNode struct {
Name string
// contains filtered or unexported fields
}
IdentifierNode represents variable names and identifiers
func AcquireIdentifierNode ¶
func AcquireIdentifierNode(name string, line, column int) *IdentifierNode
AcquireIdentifierNode gets an IdentifierNode from the pool
func NewIdentifierNode ¶
func NewIdentifierNode(name string, line, column int) *IdentifierNode
func (*IdentifierNode) ExpressionNode ¶
func (n *IdentifierNode) ExpressionNode()
func (*IdentifierNode) String ¶
func (n *IdentifierNode) String() string
type IfNode ¶
type IfNode struct {
Condition ExpressionNode
Body []Node
ElseIfs []*IfNode
Else []Node
// contains filtered or unexported fields
}
IfNode represents if/elif/else statements
func NewIfNode ¶
func NewIfNode(condition ExpressionNode, line, column int) *IfNode
func (*IfNode) StatementNode ¶
func (n *IfNode) StatementNode()
type ImportNode ¶
type ImportNode struct {
Template ExpressionNode // The template to import
Alias string // The alias name for the imported template
// contains filtered or unexported fields
}
ImportNode represents import statements ({% import 'template.html' as name %})
func NewImportNode ¶
func NewImportNode(line, column int, template ExpressionNode, alias string) *ImportNode
func (*ImportNode) StatementNode ¶
func (n *ImportNode) StatementNode()
func (*ImportNode) String ¶
func (n *ImportNode) String() string
type IncludeNode ¶
type IncludeNode struct {
Template ExpressionNode
Context ExpressionNode // optional
IgnoreMissing bool
// contains filtered or unexported fields
}
IncludeNode represents template inclusion
func NewIncludeNode ¶
func NewIncludeNode(template ExpressionNode, line, column int) *IncludeNode
func (*IncludeNode) StatementNode ¶
func (n *IncludeNode) StatementNode()
func (*IncludeNode) String ¶
func (n *IncludeNode) String() string
type ListNode ¶
type ListNode struct {
Elements []ExpressionNode
// contains filtered or unexported fields
}
ListNode represents list literals [1, 2, 3]
func NewListNode ¶
func NewListNode(elements []ExpressionNode, line, column int) *ListNode
func (*ListNode) ExpressionNode ¶
func (n *ListNode) ExpressionNode()
type LiteralNode ¶
type LiteralNode struct {
Value interface{}
Raw string
// contains filtered or unexported fields
}
LiteralNode represents literal values (strings, numbers, booleans)
func AcquireLiteralNode ¶
func AcquireLiteralNode(value interface{}, raw string, line, column int) *LiteralNode
AcquireLiteralNode gets a LiteralNode from the pool
func NewLiteralNode ¶
func NewLiteralNode(value interface{}, raw string, line, column int) *LiteralNode
func (*LiteralNode) ExpressionNode ¶
func (n *LiteralNode) ExpressionNode()
func (*LiteralNode) FastEval ¶
func (n *LiteralNode) FastEval(e interface{}, ctx interface{}) (interface{}, error)
FastEval for LiteralNode - direct value return
func (*LiteralNode) String ¶
func (n *LiteralNode) String() string
type MacroNode ¶
type MacroNode struct {
Name string
Parameters []string
Defaults map[string]ExpressionNode
Body []Node
// contains filtered or unexported fields
}
MacroNode represents macro definitions
func NewMacroNode ¶
func (*MacroNode) StatementNode ¶
func (n *MacroNode) StatementNode()
type NodePoolStats ¶
type NodePoolStats struct {
LiteralNodes int
IdentifierNodes int
BinaryOpNodes int
FilterNodes int
UnaryOpNodes int
AttributeNodes int
GetItemNodes int
CallNodes int
}
NodePoolStats returns statistics about node pool usage. This is useful for debugging and performance tuning.
func GetNodePoolStats ¶
func GetNodePoolStats() NodePoolStats
Note: sync.Pool doesn't expose internal statistics, so this function is a placeholder for future instrumentation. For now, pool effectiveness should be measured via benchmarks.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser parses tokens into an AST
func (*Parser) ErrorPublic ¶
ErrorPublic exposes the error method for extensions
func (*Parser) GetCurrentPosition ¶
GetCurrentPosition returns the current parser position for extensions
func (*Parser) Parse ¶
func (p *Parser) Parse() (*TemplateNode, error)
Parse parses the tokens into a template AST
func (*Parser) ParseBlockStatementPublic ¶
ParseBlockStatementPublic exposes parseBlockStatement for extensions
func (*Parser) ParseExpressionPublic ¶
func (p *Parser) ParseExpressionPublic() (ExpressionNode, error)
ParseExpressionPublic exposes parseExpression for extensions
func (*Parser) ParseTopLevelPublic ¶
ParseTopLevelPublic exposes parseTopLevel for extensions
func (*Parser) Peek ¶
Additional public methods for extension parser support Peek exposes the peek method for extensions
func (*Parser) PeekBlockTypePublic ¶
PeekBlockTypePublic exposes peekBlockType for extensions
func (*Parser) SetCurrentPosition ¶
SetCurrentPosition sets the current parser position for extensions
type RawNode ¶
type RawNode struct {
Content string
// contains filtered or unexported fields
}
RawNode represents raw blocks {% raw %}...{% endraw %}
func NewRawNode ¶
type SetNode ¶
type SetNode struct {
Targets []ExpressionNode // Support multiple targets for tuple unpacking (can be identifiers or attributes)
Value ExpressionNode // The value expression to assign
// contains filtered or unexported fields
}
SetNode represents variable assignment (supports both single and multiple assignment)
func NewMultiSetNode ¶
func NewMultiSetNode(variables []string, value ExpressionNode, line, column int) *SetNode
func NewSetNode ¶
func NewSetNode(variable string, value ExpressionNode, line, column int) *SetNode
func NewSetNodeWithTargets ¶
func NewSetNodeWithTargets(targets []ExpressionNode, value ExpressionNode, line, column int) *SetNode
func (*SetNode) StatementNode ¶
func (n *SetNode) StatementNode()
type SliceNode ¶
type SliceNode struct {
Object ExpressionNode
Start ExpressionNode // optional
End ExpressionNode // optional
Step ExpressionNode // optional
// contains filtered or unexported fields
}
SliceNode represents slice expressions (array[start:end:step])
func NewSliceNode ¶
func NewSliceNode(object ExpressionNode, line, column int) *SliceNode
func (*SliceNode) ExpressionNode ¶
func (n *SliceNode) ExpressionNode()
type StatementNode ¶
type StatementNode interface {
Node
StatementNode()
}
StatementNode represents template statements
type SuperNode ¶
type SuperNode struct {
// contains filtered or unexported fields
}
SuperNode represents super() calls in template inheritance
func NewSuperNode ¶
func (*SuperNode) ExpressionNode ¶
func (n *SuperNode) ExpressionNode()
type TemplateNode ¶
TemplateNode represents the root of a template AST
func NewTemplateNode ¶
func NewTemplateNode(name string, line, column int) *TemplateNode
func (*TemplateNode) String ¶
func (n *TemplateNode) String() string
type TestNode ¶
type TestNode struct {
Expression ExpressionNode
TestName string
Arguments []ExpressionNode
Negated bool // for "is not" tests
// contains filtered or unexported fields
}
TestNode represents test expressions (variable is defined, value is none)
func NewTestNode ¶
func NewTestNode(expr ExpressionNode, testName string, line, column int) *TestNode
func (*TestNode) ExpressionNode ¶
func (n *TestNode) ExpressionNode()
type TextNode ¶
type TextNode struct {
Content string
// contains filtered or unexported fields
}
TextNode represents plain text content
func NewTextNode ¶
type UnaryOpNode ¶
type UnaryOpNode struct {
Operator string
Operand ExpressionNode
// contains filtered or unexported fields
}
UnaryOpNode represents unary operations (not x, -x)
func AcquireUnaryOpNode ¶
func AcquireUnaryOpNode(op string, operand ExpressionNode, line, column int) *UnaryOpNode
AcquireUnaryOpNode gets a UnaryOpNode from the pool
func NewUnaryOpNode ¶
func NewUnaryOpNode(op string, operand ExpressionNode, line, column int) *UnaryOpNode
func (*UnaryOpNode) ExpressionNode ¶
func (n *UnaryOpNode) ExpressionNode()
func (*UnaryOpNode) String ¶
func (n *UnaryOpNode) String() string
type VariableNode ¶
type VariableNode struct {
Expression Node
// contains filtered or unexported fields
}
VariableNode represents variable interpolation {{ var }}
func NewVariableNode ¶
func NewVariableNode(expr Node, line, column int) *VariableNode
func (*VariableNode) String ¶
func (n *VariableNode) String() string
type WithNode ¶
type WithNode struct {
Assignments map[string]ExpressionNode // Variable assignments like var1=expr1, var2=expr2
Body []Node // The content between {% with %} and {% endwith %}
// contains filtered or unexported fields
}
WithNode represents with statements {% with var = expr %}...{% endwith %}
func NewWithNode ¶
func NewWithNode(assignments map[string]ExpressionNode, body []Node, line, column int) *WithNode
func (*WithNode) StatementNode ¶
func (n *WithNode) StatementNode()