r-yaml
r-yaml copied to clipboard
Support for document boundary markers
YAML supports "multiple documents in one file" with boundary markers (---
), see https://yaml.org/spec/1.1/#id897596
From searching the source code, it seems like the underlying library does communicate document beginnings and ends from within the same stream: https://github.com/viking/r-yaml/search?q=document+stream&unscoped_q=document+stream
Probably related to your thoughts about switching the underlying library for #76 and might also require considerable changes in the API.
Looking forward to hear your thoughts on that!
I'm not sure how to best go about supporting that. I'd probably need to add a parameter to yaml.load
that turns on the functionality in order to keep backward compatibility. If a hypothetical multiple
parameter was set to true, for example, yaml.load
could return a list of documents.
I agree backwards compatibility is first goal.
If the user has to decide if to use the parameter, maybe a different function yaml.load.multiple
is an option?
I think output should also be supported by a similar parameter. I.e., the provided object must be a list that will become documents. I think I can do this first and learn the document interface in libyaml.