InsertPotentialSimpleKey . If we can, add a potential simple key to the queue, and save it on a stack.
| 56 | // . If we can, add a potential simple key to the queue, |
| 57 | // and save it on a stack. |
| 58 | void Scanner::InsertPotentialSimpleKey() { |
| 59 | if (!CanInsertPotentialSimpleKey()) |
| 60 | return; |
| 61 | |
| 62 | SimpleKey key(INPUT.mark(), GetFlowLevel()); |
| 63 | |
| 64 | // first add a map start, if necessary |
| 65 | if (InBlockContext()) { |
| 66 | key.pIndent = PushIndentTo(INPUT.column(), IndentMarker::MAP); |
| 67 | if (key.pIndent) { |
| 68 | key.pIndent->status = IndentMarker::UNKNOWN; |
| 69 | key.pMapStart = key.pIndent->pStartToken; |
| 70 | key.pMapStart->status = Token::UNVERIFIED; |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | // then add the (now unverified) key |
| 75 | m_tokens.push(Token(Token::KEY, INPUT.mark())); |
| 76 | key.pKey = &m_tokens.back(); |
| 77 | key.pKey->status = Token::UNVERIFIED; |
| 78 | |
| 79 | m_simpleKeys.push(key); |
| 80 | } |
| 81 | |
| 82 | // InvalidateSimpleKey |
| 83 | // . Automatically invalidate the simple key in our flow level |