Skip to content

anchor in sequence dereferenced in a map fail, replaced by a scalar. #268

@Schwartzp

Description

@Schwartzp

I was using the library in order to parse a yaml to json.
I had this yaml as input :

Constants:
  - &bar bar
Thisis: 
  ATree: *bar

Strangely instead of "{"ATree" : "bar"} in the last map i had "bar" in the json emitted document.

my code:

std::string strIn; // input yaml string 
auto tree = ryml::parse_in_place(ryml::to_substr(strIn));
tree.resolve(); 
std::string out = ryml::emitrs_json<std::string>(tree);

Putting " - bar: &bar bar" in the first line of the yaml did the trick. But i believe this may be a bug.
Thanks for the library by the way !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions