Closed theamarin closed 2 years ago
That's a parser bug. I suggest not having the comment there for now until I figure out how to fix this.
There is special handling necessary for comments after block scalars, which allows comments there that are less indented than the scalar (otherwise they would be scalar content) but more than the surrounding level. I assume the code implementing that is broken somehow, which causes this problem. Or perhaps it's the code handling +
indicator that doesn't eat as many tokens from the stream as it should. Possibly a combination of both.
I had a quick look on the code but this doesn't seem to be a trivial fix. It might take some time as this is a low-prio project for me, sorry about that.
Thank you so much for your quick and thorough reply!
The issue remains the same without the +
indicator.
Indenting the comment so it is in line with the - id:first
sequence:
sequence:
- id: first
multi: |+
Multi-line text
# Comment
- id: second
leads to the stack trace ending with
yaml/parser.nim(712) beforeBlockMapKey
Maybe this helps. Thanks again!
Hi, thanks to @flyx for your great work! I just found that the following yaml snippet won't parse with NimYAML. A minimum non-working example:
It raises:
Error: unhandled exception: Illegal token (expected block sequence indicator): Indentation [YamlParserError]
Call stack:
I am using the latest commit in the
devel
branch (89e18ce).Do you have any ideas how to fix this?