Reductions in web2c.y are improperly reported.

Reported by Mike Castle.
* src/conflicts.c (print_reductions): Fix.
* tests/regression.at (Web2c): New.
This commit is contained in:
Akim Demaille
2001-12-22 14:41:15 +00:00
parent 12a04365ce
commit 55b4181996
6 changed files with 121 additions and 6 deletions

View File

@@ -414,7 +414,6 @@ void
print_reductions (FILE *out, int state)
{
int i;
int j;
int m;
int n;
shifts *shiftp;
@@ -463,8 +462,6 @@ print_reductions (FILE *out, int state)
}
else if (n - m >= 1)
{
int k;
int cmax = 0;
int default_LA = -1;
int default_rule = 0;
@@ -473,6 +470,7 @@ print_reductions (FILE *out, int state)
for (i = m; i < n; i++)
{
int count = 0;
int j, k;
for (k = 0; k < tokensetsize; ++k)
lookaheadset[k] = LA (i)[k] & ~shiftset[k];
@@ -501,12 +499,13 @@ print_reductions (FILE *out, int state)
for (i = 0; i < ntokens; i++)
{
int j;
int defaulted = 0;
int count = BITISSET (shiftset, i);
for (j = m; j < n; j++)
{
if (BITISSET (LA (m), j))
if (BITISSET (LA (j), i))
{
if (count == 0)
{