in lib/yamlcpp/src/emitter.cpp [359:391]
void Emitter::BlockSeqPrepareNode(EmitterNodeType::value child) {
const std::size_t curIndent = m_pState->CurIndent();
const std::size_t nextIndent = curIndent + m_pState->CurGroupIndent();
if (child == EmitterNodeType::NoType)
return;
if (!m_pState->HasBegunContent()) {
if (m_pState->CurGroupChildCount() > 0 || m_stream.comment()) {
m_stream << "\n";
}
m_stream << IndentTo(curIndent);
m_stream << "-";
}
switch (child) {
case EmitterNodeType::NoType:
break;
case EmitterNodeType::Property:
case EmitterNodeType::Scalar:
case EmitterNodeType::FlowSeq:
case EmitterNodeType::FlowMap:
SpaceOrIndentTo(m_pState->HasBegunContent(), nextIndent);
break;
case EmitterNodeType::BlockSeq:
m_stream << "\n";
break;
case EmitterNodeType::BlockMap:
if (m_pState->HasBegunContent() || m_stream.comment())
m_stream << "\n";
break;
}
}