mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-21 19:51:27 +00:00
Lemon update 2015-09-04 18:03:45 on branch trunk
- Fix over-length source code lines in Lemon. (user: drh)
This commit is contained in:
parent
9413ea15b6
commit
23f69b6fbc
1 changed files with 22 additions and 8 deletions
|
@ -1279,14 +1279,16 @@ void Configlist_closure(struct lemon *lemp)
|
|||
|
||||
/* Sort the configuration list */
|
||||
void Configlist_sort(){
|
||||
current = (struct config *)msort(current,&(current->next),Configcmp);
|
||||
current = (struct config*)msort((char*)current,(char**)&(current->next),
|
||||
Configcmp);
|
||||
currentend = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sort the basis configuration list */
|
||||
void Configlist_sortbasis(){
|
||||
basis = (struct config *)msort(current,&(current->bp),Configcmp);
|
||||
basis = (struct config *)msort((char*)current,(char**)&(current->bp),
|
||||
Configcmp);
|
||||
basisend = 0;
|
||||
return;
|
||||
}
|
||||
|
@ -1529,7 +1531,8 @@ int main(int argc, char **argv)
|
|||
if( statistics ){
|
||||
printf("Parser statistics: %d terminals, %d nonterminals, %d rules\n",
|
||||
lem.nterminal, lem.nsymbol - lem.nterminal, lem.nrule);
|
||||
printf(" %d states, %d parser table entries, %d conflicts\n",
|
||||
printf(" %d states, %d parser table entries,"
|
||||
" %d conflicts\n",
|
||||
lem.nstate, lem.tablesize, lem.nconflict);
|
||||
}
|
||||
if( lem.nconflict ){
|
||||
|
@ -1780,7 +1783,8 @@ static int handleswitch(int i, FILE *err)
|
|||
dv = strtod(cp,&end);
|
||||
if( *end ){
|
||||
if( err ){
|
||||
fprintf(err,"%sillegal character in floating-point argument.\n",emsg);
|
||||
fprintf(err,
|
||||
"%sillegal character in floating-point argument.\n",emsg);
|
||||
errline(i,((size_t)end)-(size_t)argv[i],err);
|
||||
}
|
||||
errcnt++;
|
||||
|
@ -3157,7 +3161,8 @@ PRIVATE FILE *tplt_open(struct lemon *lemp)
|
|||
}
|
||||
in = fopen(user_templatename,"rb");
|
||||
if( in==0 ){
|
||||
fprintf(stderr,"Can't open the template file \"%s\".\n",user_templatename);
|
||||
fprintf(stderr,"Can't open the template file \"%s\".\n",
|
||||
user_templatename);
|
||||
lemp->errorcnt++;
|
||||
return 0;
|
||||
}
|
||||
|
@ -3248,7 +3253,10 @@ void emit_destructor_code(
|
|||
}else if( sp->destructor ){
|
||||
cp = sp->destructor;
|
||||
fprintf(out,"{\n"); (*lineno)++;
|
||||
if (!lemp->nolinenosflag) { (*lineno)++; tplt_linedir(out,sp->destLineno,lemp->filename); }
|
||||
if( !lemp->nolinenosflag ){
|
||||
(*lineno)++;
|
||||
tplt_linedir(out,sp->destLineno,lemp->filename);
|
||||
}
|
||||
}else if( lemp->vardest ){
|
||||
cp = lemp->vardest;
|
||||
if( cp==0 ) return;
|
||||
|
@ -3445,13 +3453,19 @@ PRIVATE void emit_code(
|
|||
|
||||
/* Generate code to do the reduce action */
|
||||
if( rp->code ){
|
||||
if (!lemp->nolinenosflag) { (*lineno)++; tplt_linedir(out,rp->line,lemp->filename); }
|
||||
if( !lemp->nolinenosflag ){
|
||||
(*lineno)++;
|
||||
tplt_linedir(out,rp->line,lemp->filename);
|
||||
}
|
||||
fprintf(out,"{%s",rp->code);
|
||||
for(cp=rp->code; *cp; cp++){
|
||||
if( *cp=='\n' ) (*lineno)++;
|
||||
} /* End loop */
|
||||
fprintf(out,"}\n"); (*lineno)++;
|
||||
if (!lemp->nolinenosflag) { (*lineno)++; tplt_linedir(out,*lineno,lemp->outname); }
|
||||
if( !lemp->nolinenosflag ){
|
||||
(*lineno)++;
|
||||
tplt_linedir(out,*lineno,lemp->outname);
|
||||
}
|
||||
} /* End if( rp->code ) */
|
||||
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue