mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Fix a bug in lemon in computation of which non-terminals can generate an
empty string. This bug and the fix make absolutely no difference for the grammar used by SQLite, but it can make a difference when lemon is used in other grammars. FossilOrigin-Name: ce32775b232da894343f62deefaf19b0ec484636
This commit is contained in:
@ -686,8 +686,9 @@ void FindFirstSets(struct lemon *lemp)
|
||||
for(rp=lemp->rule; rp; rp=rp->next){
|
||||
if( rp->lhs->lambda ) continue;
|
||||
for(i=0; i<rp->nrhs; i++){
|
||||
struct symbol *sp = rp->rhs[i];
|
||||
if( sp->type!=TERMINAL || sp->lambda==LEMON_FALSE ) break;
|
||||
struct symbol *sp = rp->rhs[i];
|
||||
assert( sp->type==NONTERMINAL || sp->lambda==LEMON_FALSE );
|
||||
if( sp->lambda==LEMON_FALSE ) break;
|
||||
}
|
||||
if( i==rp->nrhs ){
|
||||
rp->lhs->lambda = LEMON_TRUE;
|
||||
|
Reference in New Issue
Block a user