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

Indicator character emitted as plain scalar unexpectedly #309

Closed
PIG208 opened this issue Sep 27, 2022 · 0 comments · Fixed by #310
Closed

Indicator character emitted as plain scalar unexpectedly #309

PIG208 opened this issue Sep 27, 2022 · 0 comments · Fixed by #310

Comments

@PIG208
Copy link
Contributor

PIG208 commented Sep 27, 2022

When doing something like this:

ryml::Tree tree;
ryml::NodeRef wroot = tree.rootref();
wroot |= ryml::MAP;
wroot["name"] << "@test";
ryml::emit_yaml(wroot, stdout)

The output is

name: @test

while it is expected to be

name: '@test'

since "reserved indicators can't start a plain scalar."

I'm aware that ryml tends to be more permissive but in this case the generated output
cannot be parsed by other standard compliant parsers.

Reference: https://yaml.org/spec/1.2.2/#57-escaped-characters, example 5.10

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

Successfully merging a pull request may close this issue.

1 participant