YAMP.IfKeyword.Interpret C# (CSharp) Method

Interpret() public method

public Interpret ( Value>.IDictionary symbols ) : Value
symbols Value>.IDictionary
return Value
        public override Value Interpret(IDictionary<String, Value> symbols)
        {
            var condition = Condition.Interpret(symbols);

            if (condition != null && condition is ScalarValue)
            {
                var boolean = (ScalarValue)condition;

                if (boolean.IsTrue)
                {
                    return Body.Interpret(symbols);
                }
            }

            if (Else != null)
            {
                return Else.Body.Interpret(symbols);
            }

            return null;
        }