glr: fix ambiguity reports.

Fix a regression introduced in commit
783aa653f4.

	* tests/glr-regression.at (Ambiguity reports): New.
	* data/glr.c (yyreportTree): Fix an offset error.
This commit is contained in:
Akim Demaille
2012-02-21 11:51:37 +01:00
parent d4fca42763
commit a6b2f4fc02
2 changed files with 119 additions and 2 deletions

View File

@@ -1727,10 +1727,10 @@ yyreportTree (yySemanticOption* yyx, int yyindent)
{
if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn)
YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
yytokenName (yystos[yystates[yyi-1]->yylrState]));
yytokenName (yystos[yystates[yyi]->yylrState]));
else
YYFPRINTF (stderr, "%*s%s <tokens %lu .. %lu>\n", yyindent+2, "",
yytokenName (yystos[yystates[yyi-1]->yylrState]),
yytokenName (yystos[yystates[yyi]->yylrState]),
(unsigned long int) (yystates[yyi-1]->yyposn + 1),
(unsigned long int) yystates[yyi]->yyposn);
}