@Override protected SoyData visitNotEqualOpNode(NotEqualOpNode node) { SoyData operand0 = visit(node.getChild(0)); SoyData operand1 = visit(node.getChild(1)); return convertResult(!operand0.equals(operand1)); }
@Override protected SoyData visitEqualOpNode(EqualOpNode node) { SoyData operand0 = visit(node.getChild(0)); SoyData operand1 = visit(node.getChild(1)); return convertResult(operand0.equals(operand1)); }
@Override protected void visitSwitchNode(SwitchNode node) { SoyData switchValue = eval(node.getExpr()); for (SoyNode child : node.getChildren()) { if (child instanceof SwitchCaseNode) { SwitchCaseNode scn = (SwitchCaseNode) child; for (ExprNode caseExpr : scn.getExprList()) { if (switchValue.equals(eval(caseExpr))) { visit(scn); return; } } } else if (child instanceof SwitchDefaultNode) { visit(child); return; } else { throw new AssertionError(); } } }
if (caseExprValue == null) { hasAllNonmatchingConstants = false; } else if (caseExprValue.equals(switchExprValue)) { hasMatchingConstant = true; hasAllNonmatchingConstants = false;