Skip to content

Commit

Permalink
emit: disable uncovered statements
Browse files Browse the repository at this point in the history
  • Loading branch information
biojppm committed May 5, 2024
1 parent eae27a3 commit 9225274
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/c4/yml/emit.def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,20 @@ void Emitter<Writer>::_write_doc(id_type id)
this->Writer::_do_write(' ');
this->Writer::_do_write('&');
this->Writer::_do_write(m_tree->val_anchor(id));
#ifdef RYML_NO_COVERAGE__TO_BE_DELETED
if(m_tree->has_children(id) && m_tree->is_root(id))
this->Writer::_do_write('\n');
#endif
}
else if(tag && !anchor)
{
if(!m_tree->is_root(id))
this->Writer::_do_write(' ');
_write_tag(m_tree->val_tag(id));
#ifdef RYML_NO_COVERAGE__TO_BE_DELETED
if(m_tree->has_children(id) && m_tree->is_root(id))
this->Writer::_do_write('\n');
#endif
}
else // tag && anchor
{
Expand All @@ -202,8 +206,10 @@ void Emitter<Writer>::_write_doc(id_type id)
_write_tag(m_tree->val_tag(id));
this->Writer::_do_write(" &");
this->Writer::_do_write(m_tree->val_anchor(id));
#ifdef RYML_NO_COVERAGE__TO_BE_DELETED
if(m_tree->has_children(id) && m_tree->is_root(id))
this->Writer::_do_write('\n');
#endif
}
}
else // docval
Expand Down Expand Up @@ -261,9 +267,11 @@ void Emitter<Writer>::_do_visit_flow_sl(id_type node, id_type ilevel)
if(m_tree->is_doc(node))
{
_write_doc(node);
#ifdef RYML_NO_COVERAGE__TO_BE_DELETED
if(!m_tree->has_children(node))
return;
else
#endif
{
if(m_tree->is_map(node))
{
Expand Down

0 comments on commit 9225274

Please sign in to comment.