gvvaughan / lyaml

LibYAML binding for Lua.
gvvaughan.github.io/lyaml
Other
208 stars 34 forks source link

null loaded as string #13

Closed achalddave closed 7 years ago

achalddave commented 7 years ago

It seems null is parsed as a string in lyaml instead of as a 'nil' type, unless I'm missing something. Here's an example showing the issue, and a comparison with what Python does.

https://gist.github.com/achalddave/0c8acc998acb21b4372d02d0b0650b12

gvvaughan commented 7 years ago

Thanks for the report; I can't believe I missed that every time I read the spec docs!

In order to be compliant with the spec, which requires support of null keys into maps, we can't map yaml null directly onto Lua nil, but with this commit we do at least get lyaml.null objects.