public override object Evaluate(TemplateScopeContext scope) { var test = Test.EvaluateToBool(scope); var value = test ? Consequent.Evaluate(scope) : Alternate.Evaluate(scope); return(value); }
public override IValue Evaluate(Environment env) { IValue predValue = Predicate.Evaluate(env); if (Boolean.IsTrue(predValue)) { return(Consequent.Evaluate(env)); } else if (Alternative == null) { return(Boolean.FalseLiteral); } else { return(Alternative.Evaluate(env)); } }