Skip to content

Fix parsing comment after list.#116

Open
smnaugle wants to merge 1 commit intokubkon:mainfrom
smnaugle:comment-after-array
Open

Fix parsing comment after list.#116
smnaugle wants to merge 1 commit intokubkon:mainfrom
smnaugle:comment-after-array

Conversation

@smnaugle
Copy link
Contributor

This PR excludes newlines and spaces when checking for comment after closing bracket in a list. Previously, YAML source text like this:

alist: [1, 2] # A comment

or:

alist: [1, 2] 
# A comment

would cause a ParseFailure as the parser would skip over the space or newline between the closing bracket and the comment. My understanding is that this should be legal YAML. Not skipping over spaces/newlines fixes this issue.

Let me know if I should add any tests or make any changes to the PR!

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 this pull request may close these issues.

1 participant