}
@Override protected void visitPrintNode(PrintNode node) {
SoyData result = eval(node.getExprUnion().getExpr());
if (result instanceof UndefinedData) {
throw new RenderException(
"In 'print' tag, expression \"" + node.getExprText() + "\" evaluates to undefined.");
}
// Process directives.
for (PrintDirectiveNode directiveNode : node.getChildren()) {
// Evaluate directive args.
List<ExprRootNode<?>> argsExprs = directiveNode.getArgs();
List<SoyData> argsSoyDatas = Lists.newArrayListWithCapacity(argsExprs.size());
for (ExprRootNode<?> argExpr : argsExprs) {
argsSoyDatas.add(evalVisitor.exec(argExpr));
}
// Apply directive.
result = applyDirective(directiveNode.getName(), result, argsSoyDatas, node);
}
append(currOutputBuf, result.toString());
}