public override void Execute(Dictionary <Expression, Expression> State) { if (cond.Evaluate(State)) { _true.Execute(State); } else { _false.Execute(State); } }
public override void Execute(Dictionary <Expression, Expression> State) { for (init.Execute(State); cond.Evaluate(State); step.Execute(State)) { try { body.Execute(State); } catch (BreakException) { break; } catch (ContinueException) { continue; } } }
public override void Execute(Dictionary <Expression, Expression> State) { do { try { body.Execute(State); } catch (BreakException) { break; } catch (ContinueException) { continue; } } while (cond.Evaluate(State)); }
public override Expression Call(IEnumerable <Expression> Args) { try { body.Execute(parameters.Zip(Args, (a, b) => Arrow.New(a, b))); } catch (ReturnException Ret) { return(Ret.Value); } throw new InvalidOperationException("Return statement not executed."); }