Skip to content
Snippets Groups Projects
Commit c2c0149f8682 authored by Tina Müller's avatar Tina Müller
Browse files

Output error position in run-parser-test-suite.c

parent 36fdfc6308c6
No related branches found
No related tags found
No related merge requests found
...@@ -30,4 +30,11 @@ ...@@ -30,4 +30,11 @@
while (1) { while (1) {
yaml_event_type_t type; yaml_event_type_t type;
if (!yaml_parser_parse(&parser, &event)) { if (!yaml_parser_parse(&parser, &event)) {
if ( parser.problem_mark.line || parser.problem_mark.column ) {
fprintf(stderr, "Parse error: %s\nLine: %lu Column: %lu\n",
parser.problem,
(unsigned long)parser.problem_mark.line + 1,
(unsigned long)parser.problem_mark.column + 1);
}
else {
fprintf(stderr, "Parse error: %s\n", parser.problem); fprintf(stderr, "Parse error: %s\n", parser.problem);
...@@ -33,4 +40,5 @@ ...@@ -33,4 +40,5 @@
fprintf(stderr, "Parse error: %s\n", parser.problem); fprintf(stderr, "Parse error: %s\n", parser.problem);
}
return 1; return 1;
} }
type = event.type; type = event.type;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment