Commit f4278fe3 authored by Jesse Beder's avatar Jesse Beder
Browse files

Added long key flow map

parent 676e0b94
...@@ -422,10 +422,59 @@ namespace YAML ...@@ -422,10 +422,59 @@ namespace YAML
void Emitter::FlowMapPrepareLongKey(EmitterNodeType::value child) void Emitter::FlowMapPrepareLongKey(EmitterNodeType::value child)
{ {
const unsigned lastIndent = m_pState->LastIndent();
if(!m_pState->HasBegunNode()) {
if(m_stream.comment())
m_stream << "\n";
m_stream << IndentTo(lastIndent);
if(m_pState->CurGroupChildCount() == 0)
m_stream << "{ ?";
else
m_stream << ", ?";
}
switch(child) {
case EmitterNodeType::None:
break;
case EmitterNodeType::Property:
case EmitterNodeType::Scalar:
case EmitterNodeType::FlowSeq:
case EmitterNodeType::FlowMap:
SpaceOrIndentTo(m_pState->HasBegunContent() || m_pState->CurGroupChildCount() > 0, lastIndent);
break;
case EmitterNodeType::BlockSeq:
case EmitterNodeType::BlockMap:
assert(false);
break;
}
} }
void Emitter::FlowMapPrepareLongKeyValue(EmitterNodeType::value child) void Emitter::FlowMapPrepareLongKeyValue(EmitterNodeType::value child)
{ {
const unsigned lastIndent = m_pState->LastIndent();
if(!m_pState->HasBegunNode()) {
if(m_stream.comment())
m_stream << "\n";
m_stream << IndentTo(lastIndent);
m_stream << ":";
}
switch(child) {
case EmitterNodeType::None:
break;
case EmitterNodeType::Property:
case EmitterNodeType::Scalar:
case EmitterNodeType::FlowSeq:
case EmitterNodeType::FlowMap:
SpaceOrIndentTo(m_pState->HasBegunContent() || m_pState->CurGroupChildCount() > 0, lastIndent);
break;
case EmitterNodeType::BlockSeq:
case EmitterNodeType::BlockMap:
assert(false);
break;
}
} }
void Emitter::FlowMapPrepareSimpleKey(EmitterNodeType::value child) void Emitter::FlowMapPrepareSimpleKey(EmitterNodeType::value child)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment