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

yamerl_parser: Fix detection of a block scalar's end #51

Merged
merged 1 commit into from
Jan 13, 2022

Conversation

dumbbell
Copy link
Collaborator

When a block scalar was ended by a document end marker, it was considered an error because of the unexpected indentation (the indentation was less than the body of the block scalar).

The problem was that this error condition was verified before checking this was a document or directives end marker.

Simply swapping the two code blocks fixes the issue.

Fixes #41.

@dumbbell dumbbell added the bug label Jan 13, 2022
@dumbbell dumbbell added this to the v0.9.0 milestone Jan 13, 2022
@dumbbell dumbbell self-assigned this Jan 13, 2022
@coveralls
Copy link

coveralls commented Jan 13, 2022

Coverage Status

Coverage increased (+0.05%) to 77.498% when pulling c97744b on fix-block-scalar-followed-by-end-of-doc into 0ba35a0 on master.

When a block scalar was ended by a document end marker, it was
considered an error because of the unexpected indentation (the
indentation was less than the body of the block scalar).

The problem was that this error condition was verified before checking
this was a document or directives end marker.

Simply swapping the two code blocks fixes the issue.

Fixes #41.
@dumbbell dumbbell force-pushed the fix-block-scalar-followed-by-end-of-doc branch from bd7f4fa to c97744b Compare January 13, 2022 10:35
@dumbbell dumbbell marked this pull request as ready for review January 13, 2022 10:45
@dumbbell dumbbell merged commit d3c10a8 into master Jan 13, 2022
@dumbbell dumbbell deleted the fix-block-scalar-followed-by-end-of-doc branch January 13, 2022 10:46
dumbbell added a commit that referenced this pull request Jan 13, 2022
This brings several bug fixes, including one which is a change of
behavior:

* @slezakattack implemented key deduplication in the construction of
  mappings, both when using proplists and maps (#39, #40).
* Report a parsing error if a block collection is unfinished when the
  end of the document is reached; e.g. when a `]` or `}` character is
  missing (#43, #50).
* Fix parsing of indented block scalar when they are finished by a
  document or directives end marker (#41, #51).

@kianmeng also fixed several typos (#47).

The Rebar configuration was updated to work with recent versions. While
working on that, the CI was switched from Travis to GitHub Actions.

Thank you to all contributors for their reports & patches!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block scalar style parse error
2 participants