mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 05:21:16 +00:00
Lemon update 2016-08-16 16:46:40 on branch trunk
— Fix a bug in destructorprocessing of Lemon. That has no impact on the SQLite grammar. The bug was introduced by prior work to optimize the Lemon-generated parser used by SQLite. (user: drh)
This commit is contained in:
parent
3b1a048885
commit
696beca40f
1 changed files with 4 additions and 2 deletions
|
@ -167,7 +167,8 @@ struct symbol {
|
||||||
int useCnt; /* Number of times used */
|
int useCnt; /* Number of times used */
|
||||||
char *destructor; /* Code which executes whenever this symbol is
|
char *destructor; /* Code which executes whenever this symbol is
|
||||||
** popped from the stack during error processing */
|
** popped from the stack during error processing */
|
||||||
int destLineno; /* Line number for start of destructor */
|
int destLineno; /* Line number for start of destructor. Set to
|
||||||
|
** -1 for duplicate destructors. */
|
||||||
char *datatype; /* The data type of information held by this
|
char *datatype; /* The data type of information held by this
|
||||||
** object. Only used if type==NONTERMINAL */
|
** object. Only used if type==NONTERMINAL */
|
||||||
int dtnum; /* The data type number. In the parser, the value
|
int dtnum; /* The data type number. In the parser, the value
|
||||||
|
@ -4387,6 +4388,7 @@ void ReportTable(
|
||||||
for(i=0; i<lemp->nsymbol; i++){
|
for(i=0; i<lemp->nsymbol; i++){
|
||||||
struct symbol *sp = lemp->symbols[i];
|
struct symbol *sp = lemp->symbols[i];
|
||||||
if( sp==0 || sp->type==TERMINAL || sp->destructor==0 ) continue;
|
if( sp==0 || sp->type==TERMINAL || sp->destructor==0 ) continue;
|
||||||
|
if( sp->destLineno<0 ) continue; /* Already emitted */
|
||||||
fprintf(out," case %d: /* %s */\n", sp->index, sp->name); lineno++;
|
fprintf(out," case %d: /* %s */\n", sp->index, sp->name); lineno++;
|
||||||
|
|
||||||
/* Combine duplicate destructors into a single case */
|
/* Combine duplicate destructors into a single case */
|
||||||
|
@ -4397,7 +4399,7 @@ void ReportTable(
|
||||||
&& strcmp(sp->destructor,sp2->destructor)==0 ){
|
&& strcmp(sp->destructor,sp2->destructor)==0 ){
|
||||||
fprintf(out," case %d: /* %s */\n",
|
fprintf(out," case %d: /* %s */\n",
|
||||||
sp2->index, sp2->name); lineno++;
|
sp2->index, sp2->name); lineno++;
|
||||||
sp2->destructor = 0;
|
sp2->destLineno = -1; /* Avoid emitting this destructor again */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue