IronRuby.Runtime.BlockParam.SetFlowControl C# (CSharp) Method

SetFlowControl() private method

private SetFlowControl ( BlockReturnReason reason, IronRuby.Runtime.RuntimeFlowControl targetFrame, ProcKind sourceProcKind ) : void
reason BlockReturnReason
targetFrame IronRuby.Runtime.RuntimeFlowControl
sourceProcKind ProcKind
return void
        internal void SetFlowControl(BlockReturnReason reason, RuntimeFlowControl targetFrame, ProcKind sourceProcKind) {
            Debug.Assert((reason == BlockReturnReason.Break) == (targetFrame != null));

            _returnReason = reason;
            _targetFrame = targetFrame;
            _sourceProcKind = sourceProcKind;
        }

Usage Example

Esempio n. 1
0
        private static void YieldBlockBreak(RuntimeFlowControl rfc, BlockParam /*!*/ ownerBlockFlowControl, BlockParam /*!*/ yieldedBlockFlowControl, object returnValue)
        {
            Assert.NotNull(ownerBlockFlowControl, yieldedBlockFlowControl);

            // target proc-converter:
            RuntimeFlowControl targetFrame = yieldedBlockFlowControl.TargetFrame;

            Debug.Assert(targetFrame != null);

            if (targetFrame.IsActiveMethod)
            {
                if (targetFrame == rfc)
                {
                    // The current primary super-frame is the proc-converter, however we are still in the block frame that needs to be unwound.
                    // Sets the owner's BFC to exit the current block (recursively up to the primary frame).
                    ownerBlockFlowControl.SetFlowControl(BlockReturnReason.Break, targetFrame, yieldedBlockFlowControl.SourceProcKind);
                    return;
                }
                else
                {
                    throw new MethodUnwinder(targetFrame, returnValue);
                }
            }
            else
            {
                throw new LocalJumpError("break from proc-closure");
            }
        }
All Usage Examples Of IronRuby.Runtime.BlockParam::SetFlowControl