Key
| 171 | |
| 172 | // Key |
| 173 | void Scanner::ScanKey() { |
| 174 | // handle keys differently in the block context (and manage indents) |
| 175 | if (InBlockContext()) { |
| 176 | if (!m_simpleKeyAllowed) |
| 177 | throw ParserException(INPUT.mark(), ErrorMsg::MAP_KEY); |
| 178 | |
| 179 | PushIndentTo(INPUT.column(), IndentMarker::MAP); |
| 180 | } |
| 181 | |
| 182 | // can only put a simple key here if we're in block context |
| 183 | m_simpleKeyAllowed = InBlockContext(); |
| 184 | |
| 185 | // eat |
| 186 | Mark mark = INPUT.mark(); |
| 187 | INPUT.eat(1); |
| 188 | m_tokens.push(Token(Token::KEY, mark)); |
| 189 | } |
| 190 | |
| 191 | // Value |
| 192 | void Scanner::ScanValue() { |