Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for document boundary markers #86

Open
nuest opened this issue Apr 6, 2020 · 3 comments
Open

Support for document boundary markers #86

nuest opened this issue Apr 6, 2020 · 3 comments
Labels

Comments

@nuest
Copy link

nuest commented Apr 6, 2020

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!

@viking
Copy link
Contributor

viking commented May 14, 2020

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.

@nuest
Copy link
Author

nuest commented May 14, 2020

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?

@spgarbet
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants