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

Comments at the beginning of the line confuse references #91

Closed
tripodsan opened this issue Feb 28, 2019 · 1 comment
Closed

Comments at the beginning of the line confuse references #91

tripodsan opened this issue Feb 28, 2019 · 1 comment

Comments

@tripodsan
Copy link
Contributor

tripodsan commented Feb 28, 2019

Commenting out lines at the first position, confuses the parser. eg:

Error document:

map:
   foo0:
     key2: value2
         
#   foo1:
#     key0: value0
#     key1: value1

   foo2:
     key3: value3

.toJSON():

[{"map": {"foo0": {"key2": "value2"}}}, {"foo2": null}, {"key3": null}, "value3"]

Successful document:

map:
   foo0:
     key2: value2
         
   #foo1:
     #key0: value0
     #key1: value1

   foo2:
     key3: value3

.toJSON():

{"map": {"foo0": {"key2": "value2"}, "foo2": {"key3": "value3"}}}
@eemeli
Copy link
Owner

eemeli commented Mar 5, 2019

This turned out to be a single-line fix, once I figured what was going on. In order to associate less-indented comments with the subsequent rather than the preceding node there's a check for the following node's indentation level, and that check wasn't dealing properly with blank lines. I'll package a new release within a few days that includes this.

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

No branches or pull requests

2 participants