[Libguestfs] [PATCH] builder: better handle some index parsing errors

Richard W.M. Jones rjones at redhat.com
Thu Apr 3 09:02:50 UTC 2014


On Thu, Apr 03, 2014 at 10:59:29AM +0200, Pino Toscano wrote:
> On Thursday 03 April 2014 09:00:43 Richard W.M. Jones wrote:
> > On Wed, Apr 02, 2014 at 06:13:59PM +0200, Pino Toscano wrote:
> > > Add a new lexer token, unused in the grammar, for the unknown lines
> > > in index files; this should allow to better handle such kind of
> > > parsing errors, removing the need to exit() directly (and leave
> > > things in an unclean state).
> > 
> > Seems OK, but is the patch incomplete?  Should something in the parser
> > handle the new symbol by displaying a better error?
> 
> The parser should now just error out when it is given a token it doesn't 
> handle- Or, at least, it is how I got it working to try to cleanly 
> handle faults in the lexer without resorting to call yyerror manually.
> 
> Instead of "unexpected character in input" now there is "syntax error" 
> as message.

OK, I saw that in my testing.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org




More information about the Libguestfs mailing list