| 358 | } |
| 359 | |
| 360 | void Scanner::PopIndent() { |
| 361 | const IndentMarker& indent = *m_indents.top(); |
| 362 | m_indents.pop(); |
| 363 | |
| 364 | if (indent.status != IndentMarker::VALID) { |
| 365 | InvalidateSimpleKey(); |
| 366 | return; |
| 367 | } |
| 368 | |
| 369 | if (indent.type == IndentMarker::SEQ) { |
| 370 | m_tokens.push(Token(Token::BLOCK_SEQ_END, INPUT.mark())); |
| 371 | } else if (indent.type == IndentMarker::MAP) { |
| 372 | m_tokens.push(Token(Token::BLOCK_MAP_END, INPUT.mark())); |
| 373 | } |
| 374 | } |
| 375 | |
| 376 | int Scanner::GetTopIndent() const { |
| 377 | if (m_indents.empty()) { |