mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Fixed anchor/tag in seq > map
This commit is contained in:
@@ -337,6 +337,8 @@ namespace YAML
|
|||||||
m_stream << "\n";
|
m_stream << "\n";
|
||||||
break;
|
break;
|
||||||
case EmitterNodeType::BlockMap:
|
case EmitterNodeType::BlockMap:
|
||||||
|
if(m_pState->HasBegunNode())
|
||||||
|
m_stream << "\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,13 +4,16 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
YAML::Emitter out;
|
YAML::Emitter out;
|
||||||
out << YAML::Anchor("monkey");
|
out << YAML::Anchor("monkey") << YAML::LocalTag("a");
|
||||||
out << YAML::BeginSeq;
|
out << YAML::BeginSeq;
|
||||||
out << "foo";
|
out << "foo";
|
||||||
out << YAML::LocalTag("hi") << "bar";
|
out << YAML::LocalTag("hi") << "bar";
|
||||||
out << YAML::BeginMap;
|
out << YAML::Anchor("asdf") << YAML::BeginMap;
|
||||||
out << "a" << "b" << "c" << "d";
|
out << "a" << "b" << "c" << "d";
|
||||||
out << YAML::EndMap;
|
out << YAML::EndMap;
|
||||||
|
out << YAML::LocalTag("hi") << YAML::BeginSeq;
|
||||||
|
out << "a" << "b";
|
||||||
|
out << YAML::EndSeq;
|
||||||
out << YAML::EndSeq;
|
out << YAML::EndSeq;
|
||||||
|
|
||||||
std::cout << out.c_str() << "\n";
|
std::cout << out.c_str() << "\n";
|
||||||
|
Reference in New Issue
Block a user