diff options
Diffstat (limited to 'tool/lemon.c')
-rw-r--r-- | tool/lemon.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tool/lemon.c b/tool/lemon.c index 75fc7aa2f..edf17cae7 100644 --- a/tool/lemon.c +++ b/tool/lemon.c @@ -3571,7 +3571,9 @@ PRIVATE int compute_action(struct lemon *lemp, struct action *ap) /* Since a SHIFT is inherient after a prior REDUCE, convert any ** SHIFTREDUCE action with a nonterminal on the LHS into a simple ** REDUCE action: */ - if( ap->sp->index>=lemp->nterminal ){ + if( ap->sp->index>=lemp->nterminal + && (lemp->errsym==0 || ap->sp->index!=lemp->errsym->index) + ){ act = lemp->minReduce + ap->x.rp->iRule; }else{ act = lemp->minShiftReduce + ap->x.rp->iRule; |