aboutsummaryrefslogtreecommitdiff
path: root/tool/lemon.c
diff options
context:
space:
mode:
authordrh <>2021-08-27 11:26:37 +0000
committerdrh <>2021-08-27 11:26:37 +0000
commit6d77a2948e86f8975c1e2ff63580dc9dcc806ee4 (patch)
treeef02f0ff13152121d23e1a1489068af98c60b4a5 /tool/lemon.c
parentb97e2ad10a2332d06039c76ba3641d4167a9359a (diff)
downloadsqlite-6d77a2948e86f8975c1e2ff63580dc9dcc806ee4.tar.gz
sqlite-6d77a2948e86f8975c1e2ff63580dc9dcc806ee4.zip
Patch lemon to fix "error" token handling, according ot
[forum:/forumpost/e680f42f53090061|forum post e680f42f53090061]. FossilOrigin-Name: 106b5e5355a3836a9756333e6dcbb13f0878a5352dab00973b8f0900879bd724
Diffstat (limited to 'tool/lemon.c')
-rw-r--r--tool/lemon.c4
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;