Ejemplo n.º 1
0
        /// <summary>
        /// Execute the statements of the block.
        /// </summary>
        internal void Run()
        {
            _executionCursor = 0;
            while (_executionCursor < _statements.Count)
            {
                RunStatement(_statements[_executionCursor]);

                BaZicInterpreter.AttemptPauseIfRequired(this);

                if (IsAborted || State.ExitMethod || State.ExitIteration || State.ExitBlockBecauseOfLabelJump)
                {
                    break;
                }

                _executionCursor++;
            }

            var parentMethodInterpreter = GetParentMethodInterpreter();

            foreach (var variable in Variables)
            {
                if (parentMethodInterpreter.DebugCallInfo.Variables.Remove(variable))
                {
                    variable.Dispose();
                }
            }
        }