| 163 | } |
| 164 | |
| 165 | void SingleDocParser::HandleBlockSequence(EventHandler& eventHandler) { |
| 166 | // eat start token |
| 167 | m_scanner.pop(); |
| 168 | m_pCollectionStack->PushCollectionType(CollectionType::BlockSeq); |
| 169 | |
| 170 | while (true) { |
| 171 | if (m_scanner.empty()) |
| 172 | throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ); |
| 173 | |
| 174 | Token token = m_scanner.peek(); |
| 175 | if (token.type != Token::BLOCK_ENTRY && token.type != Token::BLOCK_SEQ_END) |
| 176 | throw ParserException(token.mark, ErrorMsg::END_OF_SEQ); |
| 177 | |
| 178 | m_scanner.pop(); |
| 179 | if (token.type == Token::BLOCK_SEQ_END) |
| 180 | break; |
| 181 | |
| 182 | // check for null |
| 183 | if (!m_scanner.empty()) { |
| 184 | const Token& nextToken = m_scanner.peek(); |
| 185 | if (nextToken.type == Token::BLOCK_ENTRY || |
| 186 | nextToken.type == Token::BLOCK_SEQ_END) { |
| 187 | eventHandler.OnNull(nextToken.mark, NullAnchor); |
| 188 | continue; |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | HandleNode(eventHandler); |
| 193 | } |
| 194 | |
| 195 | m_pCollectionStack->PopCollectionType(CollectionType::BlockSeq); |
| 196 | } |
| 197 | |
| 198 | void SingleDocParser::HandleFlowSequence(EventHandler& eventHandler) { |
| 199 | // eat start token |
nothing calls this directly
no test coverage detected