Evaluator class

Evaluates Liquid templates by traversing and executing AST nodes.

The evaluator maintains a context for variable storage and a buffer for accumulating output during template rendering. It implements the visitor pattern through ASTVisitor to evaluate different types of AST nodes.

Available extensions

Constructors

Evaluator.new(Environment context)
Evaluator.withBuffer(Environment context, Buffer buffer)
Creates a new Evaluator instance with the provided Environment context and Buffer.

Properties

buffer Buffer
getter/setter pair
context Environment
final
currentBuffer Buffer

Available on Evaluator, provided by the BufferHandling extension

no setter
hashCode int
The hash code for this object.
no setterinherited
nodeMap Map<String, ASTNode>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createInnerEvaluator() Evaluator
Creates a new Evaluator instance with a cloned Environment context and the same Buffer.
createInnerEvaluatorWithBuffer(Buffer buffer) Evaluator
Creates a nested evaluator with a cloned context and the given buffer.
endBlockCapture() String

Available on Evaluator, provided by the BufferHandling extension

evaluate(ASTNode node) → dynamic

Available on Evaluator, provided by the Evaluation extension

evaluateAsync(ASTNode node) Future

Available on Evaluator, provided by the Evaluation extension

evaluateNodes(List<ASTNode> nodes) String

Available on Evaluator, provided by the Evaluation extension

evaluateNodesAsync(List<ASTNode> nodes) Future

Available on Evaluator, provided by the Evaluation extension

isCapturingBlock() bool

Available on Evaluator, provided by the BufferHandling extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
popBuffer() String

Available on Evaluator, provided by the BufferHandling extension

pushBuffer() → void

Available on Evaluator, provided by the BufferHandling extension

resolveAndParseTemplate(String templateName) List<ASTNode>

Available on Evaluator, provided by the Evaluation extension

resolveAndParseTemplateAsync(String templateName) Future<List<ASTNode>>

Available on Evaluator, provided by the Evaluation extension

startBlockCapture() → void

Available on Evaluator, provided by the BufferHandling extension

tmpResult(List<ASTNode> nodes) String
tmpResultAsync(List<ASTNode> nodes) Future
toString() String
A string representation of this object.
inherited
visitArrayAccess(ArrayAccess arrayAccess) → dynamic
visitArrayAccessAsync(ArrayAccess arrayAccess) Future
visitAssignment(Assignment node) → dynamic
visitAssignmentAsync(Assignment node) Future
visitBinaryOperation(BinaryOperation node) → dynamic
visitBinaryOperationAsync(BinaryOperation node) Future
visitDocument(Document node) → dynamic
visitDocumentAsync(Document node) Future
visitFilter(Filter node) → dynamic
visitFilterAsync(Filter node) Future
visitFilterExpression(FilteredExpression node) → dynamic
visitFilterExpressionAsync(FilteredExpression node) Future
visitGroupedExpression(GroupedExpression node) → dynamic
visitGroupedExpressionAsync(GroupedExpression node) Future
visitIdentifier(Identifier node) → dynamic
visitIdentifierAsync(Identifier node) Future
visitLiteral(Literal node) → dynamic
visitLiteralAsync(Literal node) Future
visitMemberAccess(MemberAccess node) → dynamic
visitMemberAccessAsync(MemberAccess node) Future
visitNamedArgument(NamedArgument node) → dynamic
visitNamedArgumentAsync(NamedArgument node) Future
visitTag(Tag node) → dynamic
visitTagAsync(Tag node) Future
visitTextNode(TextNode node) → dynamic
visitTextNodeAsync(TextNode node) Future
visitUnaryOperation(UnaryOperation node) → dynamic
visitUnaryOperationAsync(UnaryOperation node) Future
visitVariable(Variable node) → dynamic
visitVariableAsync(Variable node) Future

Operators

operator ==(Object other) bool
The equality operator.
inherited