-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
when parsing anchor_prefix and tag prefix, the code currently doesn't advance line if we happend to consume newline character.
this results in the subsequent tokens being labelled with wrong line number
case lexical_token_t::ANCHOR_PREFIX:
case lexical_token_t::TAG_PREFIX:
deserialize_node_properties(lexer, type, line, indent);
// Skip updating the current indent to avoid stacking a wrong indentation.
//
// &foo bar: baz
// ^
// the correct indent width for the "bar" node key.
+ line = lexer.get_lines_processed();
continue;
Reproduction steps
sample.yaml
values:
- &id070 !XXX
source: !YYY
name: fv
include: false
#include "fkYAML/node.hpp"
int main(int argc, char* argv[]) {
std::ifstream ifs("/tmp/sample.yaml");
fkyaml::node root = fkyaml::node::deserialize(ifs);
return 0;
}
Expected vs. actual results
wrongly throws indentation error
Minimal code example
No response
Error messages
No response
Compiler and operating system
clang17 ubuntu22
Library version
develop
Validation
- The bug also occurs if the latest version from the
develop
branch is used. - I can successfully compile and run the unit tests.
fktn-k
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working