-
Notifications
You must be signed in to change notification settings - Fork 7
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
Flow-style mapping values cause incorrect parse results #282
Comments
@stephenwhittle
Some additional changes related to this untouched topic (#175), may be required. Do you have time to check whether or not your suggestion will do by running the unit tests? |
I can confirm that the unit tests pass successfully on both MSVC and clang-cl with the suggested change, but happy for you to consider alternative solutions if you think they may be more robust for scenarios not currently covered by the test suite. |
@stephenwhittle |
#282 Don't traverse up to the parent node immediately after parsing a flow-mapping value
Description
Flow-style mappings as values of an outer mapping cause subsequent entries in the outer mapping to be placed in the wrong location in the parsed tree.
Reproduction steps
The following minimal YAML file demonstrates the issue:
Expected vs. actual results
When using
fkyaml::node::deserialize
on the above fragment, thedescription
element is placed at the top of the parsed tree as a sibling ofDIEP0
, rather than as a child of it (and sibling to theDIEPTCL[0]
node).Removing the call to
m_node_stack.pop_back()
atdeserializer.hpp:283
appears to avoid the incorrect traversal by deferring to the traversal code atdeserializer.hpp:369-375
in my testing, but I am uncertain if that is the appropriate, or sole fix, required.Minimal code example
No response
Error messages
No response
Compiler and operating system
VS 2022 (both clang-cl and msvc compilers), Win 10
Library version
8bdce5e
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: