Ticket #200 (new enhancement)
should produce cleaner error message when processing documents containing tabs
| Reported by: | liu.long@… | Owned by: | xi |
|---|---|---|---|
| Priority: | normal | Component: | libyaml |
| Severity: | normal | Keywords: | tab |
| Cc: |
Description
I am facing a problem while trying to execute a program taking YAML documents as input, and get the following error message (This error occurs when libyaml finds unparsable yaml files, in this case a Tab character used for indenting.):
The error is thrown in the 7th line as: Error: YAML syntax error - found character that cannot start any token while scanning for the next token, at line 7
Instead, I need some message like this: Error: YAML syntax error - found a tab character where intendation spaces are expected while scanning for the next token, at line 7
Tab errors, as far as I know, is very common in YAML documents, it will help a lot. In fact, the problem is very easy to fix, just add a few lines in scanner.c, line 1041:
/* Is it a tab? */
if (CHECK(parser->buffer, '\t'))
return yaml_parser_set_scanner_error(parser,
"while scanning for the next token", parser->mark,
"found a tab character where intendation spaces are expected");
