pantoniou / libfyaml

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

Unable to output a whitespace only string using `fy_emit_vevent` #109

Closed kdubb closed 3 months ago

kdubb commented 4 months ago

I cannot find a way to write a whitespace-only string of any length using fy_emit_vevent. It always outputs an empty string. Different styles output their specific version of an empty string.

I've tried in both FYECF_DEFAULT and FYEFC_PRETTY modes with the same result.

After much debugging, I've only been able to glean that it thinks it should be stripping whitespace from the string, regardless of style or mode.

kdubb commented 4 months ago

I added the following as scalar-space2.yaml to the emitter-examples directory:

0: " "
a: "  "
i: "        "

It seems to pass the test, but I have yet to work out how the fy-tool testing actually works.

kdubb commented 4 months ago

Also, note that I am emitting using the streaming emitter functionality.

pantoniou commented 3 months ago

This is fixed, so closing.