Esempio n. 1
0
        public override void Compile(ByteCode bc)
        {
            using (bc.EnterSource(m_Ref))
            {
                if (bc.LoopTracker.Loops.Count == 0)
                {
                    throw new SyntaxErrorException(this.Script, m_Ref, "<break> at line {0} not inside a loop", m_Ref.FromLine);
                }

                ILoop loop = bc.LoopTracker.Loops.Peek();

                if (loop.IsBoundary())
                {
                    throw new SyntaxErrorException(this.Script, m_Ref, "<break> at line {0} not inside a loop", m_Ref.FromLine);
                }

                loop.CompileBreak(bc);
            }
        }
Esempio n. 2
0
        public override void Compile(ByteCode bc)
        {
            using (bc.EnterSource(m_Ref))
            {
                if (bc.LoopTracker.Loops.Count == 0)
                {
                    throw new SyntaxErrorException("<break> not inside a loop");
                }

                ILoop loop = bc.LoopTracker.Loops.Peek();

                if (loop.IsBoundary())
                {
                    throw new SyntaxErrorException("<break> not inside a loop");
                }

                loop.CompileBreak(bc);
            }
        }