sravanimantha / yaml-cpp

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

Emitting multiple documents with tags fails #292

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The following code attempts to emit 2 documents each with a local tag:

YAML::Emitter theEmitter;

for (int i = 0; i < 2; ++i)
{
    theEmitter << YAML::BeginDoc;
    theEmitter << YAML::LocalTag("The_Tag");
    theEmitter << YAML::BeginSeq;
    theEmitter << "Some Value";
    theEmitter << YAML::EndSeq;
    theEmitter << YAML::EndDoc;
}
std::cout << theEmitter.c_str() << std::endl;

I expected the code to print:
--- !The_Tag
- Some Value
...
--- !The_Tag
- Some Value
...

However the actual print is:
--- !The_Tag
- Some Value
...
--- !The_Tag

It looks like the call to YAML::LocalTag("The_Tag") leaves the emitter in an 
error state - however no exception is thrown.

If I remove the call to YAML::LocalTag("The_Tag") the print is OK:

---
- Some Value
...

---
- Some Value
...

I'm using yaml-cpp 0.5.1 with Xcode 5 on Mac OS 10.9.

Thanks,
Shai

Original issue reported on code.google.com by shaisha...@yahoo.co.uk on 30 Jun 2015 at 1:07

GoogleCodeExporter commented 9 years ago
Also happens with yaml-cpp 0.5.2

Original comment by shaisha...@yahoo.co.uk on 30 Jun 2015 at 1:09

GoogleCodeExporter commented 9 years ago
Does not happen with yaml-cpp 0.3.0

Original comment by shaisha...@yahoo.co.uk on 30 Jun 2015 at 1:10

GoogleCodeExporter commented 9 years ago
Can you re-file this bug on github? I've moved the project.

Original comment by jbe...@gmail.com on 30 Jun 2015 at 2:18

GoogleCodeExporter commented 9 years ago
Refiled on github as issue #321.

Original comment by shaisha...@yahoo.co.uk on 30 Jun 2015 at 4:00