fix issue743: handle the empty content of flow sep/map correctly during emitting. (#921)

* fix issue743: handle the empty content of flow sep/map correctly during emitting.

* handle the empty Tag/Anchor properly.

* delete comment
This commit is contained in:
Chen
2020-07-24 20:28:40 +08:00
committed by GitHub
parent 11917babc7
commit 1c9abc8fa4
3 changed files with 89 additions and 2 deletions

View File

@@ -160,6 +160,13 @@ void EmitterState::EndedGroup(GroupType::value type) {
return SetError(ErrorMsg::UNEXPECTED_END_MAP);
}
if (m_hasTag) {
SetError(ErrorMsg::INVALID_TAG);
}
if (m_hasAnchor) {
SetError(ErrorMsg::INVALID_ANCHOR);
}
// get rid of the current group
{
std::unique_ptr<Group> pFinishedGroup = std::move(m_groups.back());