Value
| 190 | |
| 191 | // Value |
| 192 | void Scanner::ScanValue() { |
| 193 | // and check that simple key |
| 194 | bool isSimpleKey = VerifySimpleKey(); |
| 195 | m_canBeJSONFlow = false; |
| 196 | |
| 197 | if (isSimpleKey) { |
| 198 | // can't follow a simple key with another simple key (dunno why, though - it |
| 199 | // seems fine) |
| 200 | m_simpleKeyAllowed = false; |
| 201 | } else { |
| 202 | // handle values differently in the block context (and manage indents) |
| 203 | if (InBlockContext()) { |
| 204 | if (!m_simpleKeyAllowed) |
| 205 | throw ParserException(INPUT.mark(), ErrorMsg::MAP_VALUE); |
| 206 | |
| 207 | PushIndentTo(INPUT.column(), IndentMarker::MAP); |
| 208 | } |
| 209 | |
| 210 | // can only put a simple key here if we're in block context |
| 211 | m_simpleKeyAllowed = InBlockContext(); |
| 212 | } |
| 213 | |
| 214 | // eat |
| 215 | Mark mark = INPUT.mark(); |
| 216 | INPUT.eat(1); |
| 217 | m_tokens.push(Token(Token::VALUE, mark)); |
| 218 | } |
| 219 | |
| 220 | // AnchorOrAlias |
| 221 | void Scanner::ScanAnchorOrAlias() { |