evaluateNodes method
Evaluates a list of AST nodes and writes the results to the buffer.
This method iterates through the provided list of AST nodes and evaluates each one.
For Assignment nodes, the method simply continues to the next node.
For Tag nodes, the method calls the accept method on the node, allowing the node to handle its own evaluation.
For all other node types, the method writes the result of evaluating the node to the buffer.
After evaluating all the nodes, the method returns the contents of the buffer as a string.
@param nodes The list of AST nodes to evaluate. @return The contents of the buffer as a string, representing the evaluated nodes.
Implementation
dynamic evaluateNodes(List<ASTNode> nodes) {
for (final node in nodes) {
if (node is Assignment) continue;
if (node is Tag) {
node.accept(this);
} else {
buffer.write(node.accept(this));
}
}
return buffer.toString();
}