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

Method ScanFlowEnd

lib/yamlcpp/src/scantoken.cpp:104–131  ·  view source on GitHub ↗

FlowEnd

Source from the content-addressed store, hash-verified

102
103// FlowEnd
104void Scanner::ScanFlowEnd() {
105 if (InBlockContext())
106 throw ParserException(INPUT.mark(), ErrorMsg::FLOW_END);
107
108 // we might have a solo entry in the flow context
109 if (InFlowContext()) {
110 if (m_flows.top() == FLOW_MAP && VerifySimpleKey())
111 m_tokens.push(Token(Token::VALUE, INPUT.mark()));
112 else if (m_flows.top() == FLOW_SEQ)
113 InvalidateSimpleKey();
114 }
115
116 m_simpleKeyAllowed = false;
117 m_canBeJSONFlow = true;
118
119 // eat
120 Mark mark = INPUT.mark();
121 char ch = INPUT.get();
122
123 // check that it matches the start
124 FLOW_MARKER flowType = (ch == Keys::FlowSeqEnd ? FLOW_SEQ : FLOW_MAP);
125 if (m_flows.top() != flowType)
126 throw ParserException(mark, ErrorMsg::FLOW_END);
127 m_flows.pop();
128
129 Token::TYPE type = (flowType ? Token::FLOW_SEQ_END : Token::FLOW_MAP_END);
130 m_tokens.push(Token(type, mark));
131}
132
133// FlowEntry
134void Scanner::ScanFlowEntry() {

Callers

nothing calls this directly

Calls 7

ParserExceptionFunction · 0.85
TokenClass · 0.70
markMethod · 0.45
topMethod · 0.45
pushMethod · 0.45
getMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected