Search in sources :

Example 1 with BasicExpressionCompiler

use of com.google.template.soy.jbcsrc.ExpressionCompiler.BasicExpressionCompiler in project closure-templates by google.

the class SoyNodeCompiler method compilePrintNodeAsExpression.

private SoyExpression compilePrintNodeAsExpression(PrintNode node, Label reattachPoint) {
    BasicExpressionCompiler basic = exprCompiler.asBasicCompiler(reattachPoint);
    SoyExpression value = basic.compile(node.getExpr());
    // because instead of wrapping the soy value, we would just wrap the appendable.
    for (PrintDirectiveNode printDirective : node.getChildren()) {
        value = parameterLookup.getRenderContext().applyPrintDirective(printDirective.getPrintDirective(), value, basic.compileToList(printDirective.getArgs()));
    }
    return value;
}
Also used : SoyExpression(com.google.template.soy.jbcsrc.restricted.SoyExpression) PrintDirectiveNode(com.google.template.soy.soytree.PrintDirectiveNode) BasicExpressionCompiler(com.google.template.soy.jbcsrc.ExpressionCompiler.BasicExpressionCompiler)

Aggregations

BasicExpressionCompiler (com.google.template.soy.jbcsrc.ExpressionCompiler.BasicExpressionCompiler)1 SoyExpression (com.google.template.soy.jbcsrc.restricted.SoyExpression)1 PrintDirectiveNode (com.google.template.soy.soytree.PrintDirectiveNode)1