private static Boolean ExitCurrentContext( DynLanContext DynLanContext, Exception ex) { DynLanState state = DynLanContext.CurrentState; state.CurrentLineID = Guid.Empty; Object result = null; if (state != null && state.ContextType == DynLanContextType.CLASS) { result = state.Object; } // jeśli został tylko ostatni główny context if (DynLanContext.Stack.Count == 1) { DynLanContext.Result = result; DynLanContext.IsFinished = true; } else { DynLanContext.PopContext(ex); if (DynLanContext.CurrentExpressionState != null) { DynLanContext.CurrentExpressionState.PushValue(result); } } return(true); }
////////////////////////////////////////////// private static Boolean ExitCurrentContext( DynLanContext DynLanContext, Object Result, Exception ex) { DynLanState context = DynLanContext.CurrentState; context.CurrentLineID = Guid.Empty; // jeśli został tylko ostatni główny context if (DynLanContext.Stack.Count == 1) { DynLanContext.Result = Result; DynLanContext.IsFinished = true; } else { DynLanContext.PopContext(ex); if (DynLanContext.CurrentExpressionState != null) { DynLanContext.CurrentExpressionState.PushValue(Result); } } return(true); }