1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Patch lemon to fix "error" token handling, according ot

[forum:/forumpost/e680f42f53090061|forum post e680f42f53090061].

FossilOrigin-Name: 106b5e5355a3836a9756333e6dcbb13f0878a5352dab00973b8f0900879bd724
This commit is contained in:
drh
2021-08-27 11:26:37 +00:00
parent b97e2ad10a
commit 6d77a2948e
4 changed files with 11 additions and 13 deletions

View File

@ -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;

View File

@ -985,10 +985,6 @@ void Parse(
yyact = yy_find_reduce_action(yypParser->yytos->stateno,
YYERRORSYMBOL);
if( yyact<=YY_MAX_SHIFTREDUCE ) break;
if( yyact>=YY_MIN_REDUCE && yyRuleInfoNRhs[yyact-YY_MIN_REDUCE] ){
yyact -= YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
break;
}
yy_pop_parser_stack(yypParser);
}
if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){