kastnermario / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

Compact sequence of maps format does't work with extra newlines #135

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

{{{
YAML::Emitter out;
out << YAML::Comment("Characteristics");
out << YAML::BeginSeq;
out << YAML::BeginMap;
out << YAML::Key << "color" << YAML::Value << "blue";
out << YAML::Key << "height" << YAML::Value << 120;
out << YAML::EndMap;
out << YAML::Newline << YAML::Newline;
out << YAML::Comment("Skills");
out << YAML::BeginMap;
out << YAML::Key << "attack" << YAML::Value << 23;
out << YAML::Key << "intelligence" << YAML::Value << 56;
out << YAML::EndMap;
out << YAML::EndSeq;
}}}

What is the expected output? What do you see instead?

It produces

{{{
# Characteristics
- color: blue
  height: 120

# Skills
-
  attack: 23
  intelligence: 56
}}}

and we would like

{{{
# Characteristics
- color: blue
  height: 120

# Skills
- attack: 23
  intelligence: 56
}}}

This is as of the tip, r2d28ec774955.

Original issue reported on code.google.com by jbe...@gmail.com on 21 Nov 2011 at 2:38

GoogleCodeExporter commented 8 years ago

Original comment by jbe...@gmail.com on 19 May 2012 at 9:08

GoogleCodeExporter commented 8 years ago
Fixed, r350478e88ba8 in the default repo, r350478e88ba8 in the new-api repo.

This was after a major refactoring of the emitter code, so if you find any bugs 
that have cropped up, please let me know!

Original comment by jbe...@gmail.com on 23 May 2012 at 8:37