Modify

Ticket #200 (new enhancement)

Opened 3 years ago

Last modified 32 hours ago

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");

Attachments

Change History

comment:1 Changed 3 years ago by anonymous

  • Owner changed from liu.long@… to xi

comment:2 Changed 32 hours ago by maskodok <galihadiputro87@…>

The only thing more I could hope for is documentation of all these features (other than reading through the code).  Cipto Junaedy Is this in process? Can I help? About  Unit Link Terbaik di Indonesia Commonwealth Life Investra Link

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from xi. Next status will be 'new'
The owner will be changed from xi to anonymous. Next status will be 'assigned'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.