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

Tag and Anchor in implicit key #378

Closed
stdio2016 opened this issue Apr 13, 2022 · 2 comments
Closed

Tag and Anchor in implicit key #378

stdio2016 opened this issue Apr 13, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@stdio2016
Copy link

Describe the bug
When I test YAML packages, I found some seemingly correct YAML cannot be parsed by this package.
Specifically, when tags or anchors occur in all but first implicit key, and map containing such key is not the top level node, this package reports a syntax error.

To Reproduce

var yaml = require('yaml');

var doc1 = `
some:
  !!str &a1 "foo":
    !!str bar
  &a2 baz : *a1`;
// error on yaml
console.log(yaml.parse(doc1));

Expected behaviour
I don't know if this is legal YAML. However, line 2 ~ 4 of doc1 is copied from yaml 1.2.2 spec.

Versions (please complete the following information):

  • Environment:
  • Node.js: 16.13.1
  • yaml: 2.0.0
  • js-yaml: 4.1.0
@stdio2016 stdio2016 added the bug Something isn't working label Apr 13, 2022
@eemeli
Copy link
Owner

eemeli commented Apr 14, 2022

Yah, this is a bug in the CST parser. Will fix & release a patch version within the next few days.

@eemeli
Copy link
Owner

eemeli commented Apr 15, 2022

Should be fixed now in release 2.0.1.

@eemeli eemeli closed this as completed Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants