jbeder / yaml-cpp

A YAML parser and emitter in C++
MIT License
4.91k stars 1.78k forks source link

Remnants of YAML 1.1 Spec in YAML 1.2 #1198

Open rengzhengcodes opened 1 year ago

rengzhengcodes commented 1 year ago

Hello!

I believe there may be an error in how the current codebase handles true/false value resolution for YAML 1.2. The lines in question are linked below: https://github.com/jbeder/yaml-cpp/blob/0e6e28d1a38224fc8172fae0109ea7f673c096db/src/convert.cpp#L49-L55

According to this section of the YAML 1.2 guide: https://yaml.org/spec/1.2-old/spec.html#id2805071

Only variants on "true"/"false" in the YAML file should resolve to the booleans. However, the above-linked code also resolves three other ways to represent booleans outside of 1.2 specs but was present in 1.1 specs.

jbeder commented 5 months ago

Yep, fair; will accept a PR.