-
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
Parse error #347
Comments
@adjbcbc First of all, the #include <iostream>
#include <fstream> // ADDED
#include "fkYAML/node.hpp"
int main() {
std::ifstream ifs("./yamltest"); // ADDED
fkyaml::node root = fkyaml::node::deserialize(ifs); // CHANGED
for (const auto &ctx : root["contexts"]) {
std::cout << ctx["context"]["cluster"].get_value<std::string>(); // error
std::cout << ctx["context"]["bug"].get_value<std::string>(); // error
}
} If a file path is given, fkYAML tries to parse the string So, I tried the input with the above code and found a bug thanks to your report. Although I'm going to fix the bug hopefully this weekend, a quick workaround is to use the slightly modified version which works fine in my environment: contexts:
- context:
cluster: abcdef
extension:
- extension:
last-update: blah
version: 0.1.0
name: blah
bug: default
ctx: ctx |
thinks for quick fix
how can i solve the above issue? |
i have confirmed that it works in my environment as well. thank you for the quick response. this is a good project! |
Description
it seems that an issue occurs when parsing yaml in the following file.
Reproduction steps
Expected vs. actual results
terminate called after throwing an instance of 'fkyaml::v0_3_7::type_error'
what(): type_error: The target node is neither of sequence nor mapping types. type=null
Aborted (core dumped)
Minimal code example
No response
Error messages
No response
Compiler and operating system
g++ 14.1.1 & linux 6.9.1-arch1-1
Library version
v0.3.7
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: