protected override Completion ExecuteImpl(ExecutionEnvironment enviroment) { if (Test == null) { return(Completion.Exception(Properties.Language.TestNullException, this)); } var t = Test.Execute(enviroment); if (t.ReturnValue is bool) { if ((bool)t.ReturnValue) { if (Consequent == null) { return(Completion.Exception(Properties.Language.NullException, this)); } return(Consequent.Execute(enviroment)); } else { if (Alternate == null) { return(Completion.Exception(Properties.Language.NullException, this)); } return(Alternate.Execute(enviroment)); } } else { return(Completion.Exception(Properties.Language.NotBoolean, Test)); } }
public Completion Execute(ExecutionEnvironment enviroment) { if (Test == null) { return(Completion.Exception("Test can not be null", this)); } var t = Test.Execute(enviroment); if (t.ReturnValue is bool) { if ((bool)t.ReturnValue) { if (Consequent == null) { return(Completion.Exception("Consequent can not be null", this)); } return(Consequent.Execute(enviroment)); } else { if (Alternate == null) { return(Completion.Exception("Alternate can not be null", this)); } return(Alternate.Execute(enviroment)); } } else { return(new Completion("Test return not boolean value", CompletionType.Exception, this)); } }
public Completion Execute(ExecutionEnvironment enviroment) { if (Test == null) { return(Completion.Void); } var t = Test.Execute(enviroment); if (t.ReturnValue is bool) { if ((bool)t.ReturnValue) { if (Consequent == null) { return(Completion.Void); } ExecutionEnvironment current = new ExecutionEnvironment(enviroment); return(Consequent.Execute(current)); } else { if (Alternate == null) { return(Completion.Void); } ExecutionEnvironment current = new ExecutionEnvironment(enviroment); return(Alternate.Execute(current)); } } else { return(new Completion("Test return not boolean value", CompletionType.Exception)); } }