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

Method ScanTag

lib/yamlcpp/src/scantoken.cpp:256–292  ·  view source on GitHub ↗

Tag

Source from the content-addressed store, hash-verified

254
255// Tag
256void Scanner::ScanTag() {
257 // insert a potential simple key
258 InsertPotentialSimpleKey();
259 m_simpleKeyAllowed = false;
260 m_canBeJSONFlow = false;
261
262 Token token(Token::TAG, INPUT.mark());
263
264 // eat the indicator
265 INPUT.get();
266
267 if (INPUT && INPUT.peek() == Keys::VerbatimTagStart) {
268 std::string tag = ScanVerbatimTag(INPUT);
269
270 token.value = tag;
271 token.data = Tag::VERBATIM;
272 } else {
273 bool canBeHandle;
274 token.value = ScanTagHandle(INPUT, canBeHandle);
275 if (!canBeHandle && token.value.empty())
276 token.data = Tag::NON_SPECIFIC;
277 else if (token.value.empty())
278 token.data = Tag::SECONDARY_HANDLE;
279 else
280 token.data = Tag::PRIMARY_HANDLE;
281
282 // is there a suffix?
283 if (canBeHandle && INPUT.peek() == Keys::Tag) {
284 // eat the indicator
285 INPUT.get();
286 token.params.push_back(ScanTagSuffix(INPUT));
287 token.data = Tag::NAMED_HANDLE;
288 }
289 }
290
291 m_tokens.push(token);
292}
293
294// PlainScalar
295void Scanner::ScanPlainScalar() {

Callers

nothing calls this directly

Calls 9

ScanVerbatimTagFunction · 0.85
ScanTagHandleFunction · 0.85
ScanTagSuffixFunction · 0.85
peekMethod · 0.80
markMethod · 0.45
getMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected