Commit c854434d authored by David Gibson's avatar David Gibson
Browse files

Correct locations in parser error messaes



The print_error() function used in several places in the parser uses the
location information in yylloc to describe the location of the error.
This is not correct in most cases.  yylloc gives the location of the
lookahead token, whereas the error is generally associated with one of
the already parsed non-terminals.

This patch corrects this, adding a location parameter to print_error() and
supplying it with the appropriate bison @N symbols.

This probably breaks yacc compatiblity, but too bad - accurate error
messages are more important.

Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent 6a15eb23
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment