-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistency between YAML and YAML::XS in Dump() results #9
Comments
I just ran into this trying to make a thing that can use either module. Is this a problem with YAML::XS::Dump or with YAML::Load? |
The problem is, the output produced by YAML::XS::Dump() can't be parsed by YAML::Load() because of no indention for the inner array. I think YAML::XS::Dump() needs to be fixed. |
No. The problem is that YAML::Load is broken.
Is valid YAML, and is what almost every modern YAML dumper will (and should) When you have a block sequence within a mapping, the '- ' counts as YAML.pm was made way before the YAML spec was finalized. It should probably not |
Ingy: I'm not sure if you are right here. The samples in the spec also use this indentation for seq elements. Should I fix libyaml dumper or YAML Loader? |
YAML::XS generates unintended seq elements. See ingydotnet/yaml-libyaml-pm#9 Ingy claims that it is valid YAML. So test for it.
Fixed with the option IndentlessMap in #43 |
@rurban
Both YAML 1.1 and 1.2 allow zero indented sequences. In general, allowing to configure indendation and other stuff in YAML::XS would be desirable, but I don't like an IndentlessMap option.
Yes, examples use zero indented sequences. So? Closing... |
Released YAML.pm 1.25_001 which supports zero indented block sequences |
There is no indent for an array in YAML::XS results, and this dump can't be loaded by YAML::Load().
Versions used: YAML v0.97, YAML::XS v0.52, perl v5.16.3 and 5.18.2
The text was updated successfully, but these errors were encountered: