YamlDotNet.Core.Parser.ParseBlockSequenceEntry C# (CSharp) Method

ParseBlockSequenceEntry() private method

Parse the productions: block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END ******************** *********** * *********
private ParseBlockSequenceEntry ( bool isFirst ) : YamlDotNet.Core.Events.ParsingEvent
isFirst bool
return YamlDotNet.Core.Events.ParsingEvent
        private ParsingEvent ParseBlockSequenceEntry(bool isFirst)
        {
            if (isFirst)
            {
                GetCurrentToken();
                Skip();
            }

            if (GetCurrentToken() is BlockEntry)
            {
                Mark mark = GetCurrentToken().End;

                Skip();
                if (!(GetCurrentToken() is BlockEntry || GetCurrentToken() is BlockEnd))
                {
                    states.Push(ParserState.BlockSequenceEntry);
                    return ParseNode(true, false);
                }
                else
                {
                    state = ParserState.BlockSequenceEntry;
                    return ProcessEmptyScalar(mark);
                }
            }
            else if (GetCurrentToken() is BlockEnd)
            {
                state = states.Pop();
                ParsingEvent evt = new Events.SequenceEnd(GetCurrentToken().Start, GetCurrentToken().End);
                Skip();
                return evt;
            }
            else
            {
                var current = GetCurrentToken();
                throw new SemanticErrorException(current.Start, current.End, "While parsing a block collection, did not find expected '-' indicator.");
            }
        }