use of com.google.template.soy.soytree.SoyNode.LocalVarNode in project closure-templates by google.
the class EnhancedAbstractExprNodeVisitor method visitVarRefNode.
@Override
protected final T visitVarRefNode(VarRefNode node) {
VarDefn defn = node.getDefnDecl();
switch(defn.kind()) {
case LOCAL_VAR:
LocalVar local = (LocalVar) defn;
LocalVarNode declaringNode = local.declaringNode();
switch(declaringNode.getKind()) {
case FOR_NONEMPTY_NODE:
return visitForLoopVar(node, local);
case LET_CONTENT_NODE:
case LET_VALUE_NODE:
return visitLetNodeVar(node, local);
default:
throw new AssertionError("Unexpected local variable: " + local);
}
case PARAM:
return visitParam(node, (TemplateParam) defn);
case IJ_PARAM:
return visitIjParam(node, (InjectedParam) defn);
case UNDECLARED:
throw new RuntimeException("undeclared params are not supported by jbcsrc");
default:
throw new AssertionError();
}
}
Aggregations