mustangostang / spyc

A simple YAML loader/dumper class for PHP
MIT License
707 stars 207 forks source link

Compatibility fixes #29

Closed ryanuber closed 11 years ago

ryanuber commented 11 years ago

I originally started this branch to experiment with some things related to #26 (opened earlier today). Spyc now reads things as one would expect (I think - give it a go and let me know what you think).

Please feel free to leave this open for a bit - no rush at all, more soliciting feedback than anything else.

It is getting a bit difficult to decide what things we should/shouldn't support in Spyc, since it does not implement any version of the YAML spec verbatim. As such, I did not remove any of the previously accepted translators like "y" or "n" for boolean values (these are not mentioned in the YAML 1.2 spec). I did, however, remove plus "+" and minus "-" for true and false values, since I couldn't find them anywhere in the YAML spec, and the minus "-" was interfering with the separations spaces implementations.

Compatibility fixes:

This commit also includes a bit of refactoring to make things a bit more effecient and respect the DRY principle a bit more.

mustangostang commented 11 years ago

Hi Ryan,

I totally agree with the removal of +/- values. "-" is especially bad. "Null" is also great.

Perhaps respecting spaces separation could create some backwards compatibility problems, but still, putting spaces before list items is definitely a best practice. Let's merge it in!