mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Added more tests for the newline, and disallowed newlines after implicit block keys
This commit is contained in:
@@ -513,8 +513,19 @@ namespace YAML
|
||||
{
|
||||
if(!good())
|
||||
return;
|
||||
|
||||
m_stream << '\n';
|
||||
|
||||
if(CanEmitNewline())
|
||||
m_stream << '\n';
|
||||
}
|
||||
|
||||
bool Emitter::CanEmitNewline() const
|
||||
{
|
||||
FLOW_TYPE flowType = m_pState->GetCurGroupFlowType();
|
||||
if(flowType == FT_BLOCK && m_pState->CurrentlyInLongKey())
|
||||
return true;
|
||||
|
||||
EMITTER_STATE curState = m_pState->GetCurState();
|
||||
return curState != ES_DONE_WITH_BLOCK_MAP_KEY && curState != ES_WAITING_FOR_BLOCK_MAP_VALUE && curState != ES_WRITING_BLOCK_MAP_VALUE;
|
||||
}
|
||||
|
||||
// *******************************************************************************************
|
||||
|
Reference in New Issue
Block a user