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

added fy_node_set_style() method. #27

Closed erichang-bcad closed 2 years ago

erichang-bcad commented 4 years ago

added the missing fy_node_set_style() method. This allows user to control how each node is formatted by the emitter (flow v.s. block style, whether to quote the value, etc.)

pantoniou commented 3 years ago

Unfortunately it's not as straightforward as changing the style. Depending on the contents of the scalar (in particular) changing the style would result in outputting something invalid.

You will have to make sure that the new style either is valid and return an error or convert the node contents into something that's valid.