* data/glr.c (YYRHSLOC): Move its definition next to its uses.

Introduce another definition to address simple location arrays.
(yyGLRStack): New member: yyerror_range.
(yyrecoverSyntaxError, yyparse): Update it.
(yyrecoverSyntaxError): Use it when shifting the error token to
have an accurate range, equivalent to the one computed by both
yacc.c and lalr1.cc.
* tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
that column numbers start at column 0, as per GNU Coding
Standards, the others tests, and the doc.
(_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
Adjust to the above change (first column is 0).
And adjust the location of the "<error>", now covering the whole
line.
This commit is contained in:
Akim Demaille
2004-10-25 10:37:35 +00:00
parent 93602febc0
commit e342c3beaf
4 changed files with 76 additions and 32 deletions

9
NEWS
View File

@@ -8,7 +8,14 @@ Changes in version 1.875e:
initializing @$) from yyparse before parsing starts.
* The option `--report=lookahead' was changed to `--report=look-ahead'.
The old spelling still works, but is not documented and will be removed.
The old spelling still works, but is not documented and will be
removed.
* Error token location.
During error recovery, the location of the syntax error is updated
to cover the whole sequence covered by the error token: it includes
the shifted symbols thrown away during the first part of the error
recovery, and the lookahead rejected during the second part.
Changes in version 1.875d, 2004-05-21: