CodeBox.CodeLexer.TokenList.ConsumeBlockForward C# (CSharp) Метод

ConsumeBlockForward() публичный Метод

public ConsumeBlockForward ( ) : void
Результат void
        public void ConsumeBlockForward()
        {
            if (Next().Value != "{")
                throw new Exception("CurrentIndex is not pointing to a block-head.");

            int braces = 0;
            Token token;

            while (true)
            {
                if (!HasNext())
                    break;

                token = Next();
                Consume();

                if (token.Value == "{")
                {
                    braces++;
                }
                else if (token.Value == "}")
                {
                    braces--;
                }

                if (braces == 0)
                    break;
            }
        }