| 196 | } |
| 197 | |
| 198 | void SingleDocParser::HandleFlowSequence(EventHandler& eventHandler) { |
| 199 | // eat start token |
| 200 | m_scanner.pop(); |
| 201 | m_pCollectionStack->PushCollectionType(CollectionType::FlowSeq); |
| 202 | |
| 203 | while (true) { |
| 204 | if (m_scanner.empty()) |
| 205 | throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ_FLOW); |
| 206 | |
| 207 | // first check for end |
| 208 | if (m_scanner.peek().type == Token::FLOW_SEQ_END) { |
| 209 | m_scanner.pop(); |
| 210 | break; |
| 211 | } |
| 212 | |
| 213 | // then read the node |
| 214 | HandleNode(eventHandler); |
| 215 | |
| 216 | if (m_scanner.empty()) |
| 217 | throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ_FLOW); |
| 218 | |
| 219 | // now eat the separator (or could be a sequence end, which we ignore - but |
| 220 | // if it's neither, then it's a bad node) |
| 221 | Token& token = m_scanner.peek(); |
| 222 | if (token.type == Token::FLOW_ENTRY) |
| 223 | m_scanner.pop(); |
| 224 | else if (token.type != Token::FLOW_SEQ_END) |
| 225 | throw ParserException(token.mark, ErrorMsg::END_OF_SEQ_FLOW); |
| 226 | } |
| 227 | |
| 228 | m_pCollectionStack->PopCollectionType(CollectionType::FlowSeq); |
| 229 | } |
| 230 | |
| 231 | void SingleDocParser::HandleMap(EventHandler& eventHandler) { |
| 232 | // split based on start token |
nothing calls this directly
no test coverage detected