Microsoft.Scripting.Interpreter.InterpretedFrame.Goto C# (CSharp) 메소드

Goto() 공개 메소드

public Goto ( int labelIndex, object value ) : int
labelIndex int
value object
리턴 int
        public int Goto(int labelIndex, object value) {
            // TODO: we know this at compile time (except for compiled loop):
            RuntimeLabel target = Interpreter._labels[labelIndex];
            if (_continuationIndex == target.ContinuationStackDepth) {
                SetStackDepth(target.StackDepth);
                if (value != Interpreter.NoValue) {
                    Data[StackIndex - 1] = value;
                }
                return target.Index - InstructionIndex;
            }

            // if we are in the middle of executing jump we forget the previous target and replace it by a new one:
            _pendingContinuation = labelIndex;
            _pendingValue = value;
            return YieldToCurrentContinuation();
        }

Usage Example

예제 #1
0
        public override int Run(InterpretedFrame frame) {
            // Are we jumping out of catch/finally while aborting the current thread?
            Interpreter.AbortThreadIfRequested(frame, _labelIndex);

            // goto the target label or the current finally continuation:
            return frame.Goto(_labelIndex, _hasValue ? frame.Pop() : Interpreter.NoValue);
        }
All Usage Examples Of Microsoft.Scripting.Interpreter.InterpretedFrame::Goto