MCPcopy Create free account
hub / github.com/apache/trafficserver / HandleFlowSequence

Method HandleFlowSequence

lib/yamlcpp/src/singledocparser.cpp:198–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void 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
231void SingleDocParser::HandleMap(EventHandler& eventHandler) {
232 // split based on start token

Callers

nothing calls this directly

Calls 7

ParserExceptionFunction · 0.85
PushCollectionTypeMethod · 0.80
peekMethod · 0.80
PopCollectionTypeMethod · 0.80
popMethod · 0.45
emptyMethod · 0.45
markMethod · 0.45

Tested by

no test coverage detected