pantoniou / libfyaml

Fully feature complete YAML parser and emitter, supporting the latest YAML spec and passing the full YAML testsuite.
MIT License
241 stars 74 forks source link

libfyaml does not adhere to the yaml specification #29

Closed m-j-son closed 3 years ago

m-j-son commented 3 years ago

We found a case where libfyaml does not adhere to the yaml specification. We're storing ip addresses in a sequence, and one of the ip addresses is "::". That is a valid IPv6 address. A very short yaml file that's valid according to the specification is

---
- ::
...

libfyaml tries to parse the :: as a mapping. It should only be a mapping if there's a space after the last colon. libfyaml is in good company making this mistake. I've tried libyaml, ruby's yaml parser, and a number of online validators. Only one got it right:

https://yamlchecker.com/

pantoniou commented 3 years ago

OK, fixed. Talk about a really weird case.

Note that for the next spec revision this will be disallowed, because it's extremely weird, no?