fktn-k / fkYAML

A C++ header-only YAML library
MIT License
67 stars 7 forks source link

Fix wrong parse result from a block sequence as a nested block mapping value #377

Closed fktn-k closed 1 month ago

fktn-k commented 1 month ago

This PR has fixed a wrong parse result generated from a YAML document which contains a block sequence as a nested block mapping value in the middle like the following:

foo:
  bar:
  - 123
  baz: true

The baz: true part mistakenly became a part of the bar block sequence's entry.
For the parser didn't get back to the proper node when a block sequence entry prefix (-) is as much indented as the parent mapping keys before parsing the baz key. (if the prefix is more indented than the keys, the parse result was correct.)

So, this PR has fixed the node traversal logic and added a new test case to validate the change.
With the fix, the above YAML document is now parsed as expected.


Pull Request Checklist

Read the CONTRIBUTING.md file for detailed information.

Please don't

github-actions[bot] commented 1 month ago

:octocat: Upload Coverage Event Notification

Coverage data has been uploaded for the commit 607a56cc171363ae6285325cd4d41cef1fadc9d3. You can download the artifact which contains the same file uploaded to the Coveralls and its HTML version.

Name fkYAML_coverage.pr377.zip
ID 1828713367
URL https://github.com/fktn-k/fkYAML/actions/runs/10458121144/artifacts/1828713367
coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 10458121144

Details


Totals Coverage Status
Change from base Build 10457203761: 0.0%
Covered Lines: 3971
Relevant Lines: 3971

💛 - Coveralls