Tag
| 254 | |
| 255 | // Tag |
| 256 | void 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 |
| 295 | void Scanner::ScanPlainScalar() { |
nothing calls this directly
no test coverage detected