mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Added ability to read compact maps in a flow sequence
This commit is contained in:
@@ -103,8 +103,12 @@ namespace YAML
|
||||
throw ParserException(INPUT.mark(), ErrorMsg::FLOW_END);
|
||||
|
||||
// we might have a solo entry in the flow context
|
||||
if(VerifySimpleKey())
|
||||
m_tokens.push(Token(Token::VALUE, INPUT.mark()));
|
||||
if(InFlowContext()) {
|
||||
if(m_flows.top() == FLOW_MAP && VerifySimpleKey())
|
||||
m_tokens.push(Token(Token::VALUE, INPUT.mark()));
|
||||
else if(m_flows.top() == FLOW_SEQ)
|
||||
InvalidateSimpleKey();
|
||||
}
|
||||
|
||||
m_simpleKeyAllowed = false;
|
||||
|
||||
@@ -125,9 +129,13 @@ namespace YAML
|
||||
// FlowEntry
|
||||
void Scanner::ScanFlowEntry()
|
||||
{
|
||||
// we might have a solo entry in the flow context
|
||||
if(VerifySimpleKey())
|
||||
m_tokens.push(Token(Token::VALUE, INPUT.mark()));
|
||||
// we might have a solo entry in the flow context
|
||||
if(InFlowContext()) {
|
||||
if(m_flows.top() == FLOW_MAP && VerifySimpleKey())
|
||||
m_tokens.push(Token(Token::VALUE, INPUT.mark()));
|
||||
else if(m_flows.top() == FLOW_SEQ)
|
||||
InvalidateSimpleKey();
|
||||
}
|
||||
|
||||
m_simpleKeyAllowed = true;
|
||||
|
||||
|
Reference in New Issue
Block a user