Fix over-length source code lines in Lemon.

FossilOrigin-Name: 1efece95ff8777b89558be59277732ba2a68d5ab
This commit is contained in:
drh 2015-09-04 18:03:45 +00:00
parent 13bf8c498f
commit 2547336dad
3 changed files with 30 additions and 17 deletions

View File

@ -1,5 +1,5 @@
C Add\ssupport\sfor\sCREATE\sINDEX\sstatements\sthat\suse\sdeterministic\sexpressions\nrather\sthan\sonly\scolumn\snames. C Fix\sover-length\ssource\scode\slines\sin\sLemon.
D 2015-09-04T17:32:19.351 D 2015-09-04T18:03:45.061
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in f85066ce844a28b671aaeeff320921cd0ce36239 F Makefile.in f85066ce844a28b671aaeeff320921cd0ce36239
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -1338,7 +1338,7 @@ F tool/fuzzershell.c f2fc86dd22df654b28851b85019d3bd007361751
F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4 F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5 F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce
F tool/lemon.c b9109f59b57e7b6f101c4fe644c8361ba6dee969 F tool/lemon.c b12cb605725dabfa3a8607ec6bd9e978973c7af9
F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862 F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862
F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6 F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6
@ -1383,8 +1383,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 3d3df79bfaf9dbc7aa711c08a19d2f6dbe744b32 5ff855293865c244ac632c630e8e7e8d7c05a5f6 P 2131a5ca53f0e9b0b98a9dd9a20e495d54d146a7
R 46fafd1e16150312779d43bb23b81793 R c504fcfc7ca364ef5b7aec55028c181c
T +closed 5ff855293865c244ac632c630e8e7e8d7c05a5f6
U drh U drh
Z 4941f6208637da2261b21635bf7704d1 Z 31da7673766f0dcc42d3887f78dbee2d

View File

@ -1 +1 @@
2131a5ca53f0e9b0b98a9dd9a20e495d54d146a7 1efece95ff8777b89558be59277732ba2a68d5ab

View File

@ -55,7 +55,7 @@ static char *msort(char*,char**,int(*)(const char*,const char*));
** saying they are unsafe. So we define our own versions of those routines too. ** saying they are unsafe. So we define our own versions of those routines too.
** **
** There are three routines here: lemon_sprintf(), lemon_vsprintf(), and ** There are three routines here: lemon_sprintf(), lemon_vsprintf(), and
** lemon_addtext(). The first two are replacements for sprintf() and vsprintf(). ** lemon_addtext(). The first two are replacements for sprintf() and vsprintf().
** The third is a helper routine for vsnprintf() that adds texts to the end of a ** The third is a helper routine for vsnprintf() that adds texts to the end of a
** buffer, making sure the buffer is always zero-terminated. ** buffer, making sure the buffer is always zero-terminated.
** **
@ -1375,14 +1375,16 @@ void Configlist_closure(struct lemon *lemp)
/* Sort the configuration list */ /* Sort the configuration list */
void Configlist_sort(){ void Configlist_sort(){
current = (struct config *)msort((char *)current,(char **)&(current->next),Configcmp); current = (struct config*)msort((char*)current,(char**)&(current->next),
Configcmp);
currentend = 0; currentend = 0;
return; return;
} }
/* Sort the basis configuration list */ /* Sort the basis configuration list */
void Configlist_sortbasis(){ void Configlist_sortbasis(){
basis = (struct config *)msort((char *)current,(char **)&(current->bp),Configcmp); basis = (struct config*)msort((char*)current,(char**)&(current->bp),
Configcmp);
basisend = 0; basisend = 0;
return; return;
} }
@ -1613,7 +1615,8 @@ int main(int argc, char **argv)
if( statistics ){ if( statistics ){
printf("Parser statistics: %d terminals, %d nonterminals, %d rules\n", printf("Parser statistics: %d terminals, %d nonterminals, %d rules\n",
lem.nterminal, lem.nsymbol - lem.nterminal, lem.nrule); 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); lem.nstate, lem.tablesize, lem.nconflict);
} }
if( lem.nconflict > 0 ){ if( lem.nconflict > 0 ){
@ -1873,7 +1876,8 @@ static int handleswitch(int i, FILE *err)
dv = strtod(cp,&end); dv = strtod(cp,&end);
if( *end ){ if( *end ){
if( err ){ if( err ){
fprintf(err,"%sillegal character in floating-point argument.\n",emsg); fprintf(err,
"%sillegal character in floating-point argument.\n",emsg);
errline(i,(int)((char*)end-(char*)argv[i]),err); errline(i,(int)((char*)end-(char*)argv[i]),err);
} }
errcnt++; errcnt++;
@ -3228,7 +3232,8 @@ PRIVATE FILE *tplt_open(struct lemon *lemp)
} }
in = fopen(user_templatename,"rb"); in = fopen(user_templatename,"rb");
if( in==0 ){ 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++; lemp->errorcnt++;
return 0; return 0;
} }
@ -3313,7 +3318,10 @@ void emit_destructor_code(
}else if( sp->destructor ){ }else if( sp->destructor ){
cp = sp->destructor; cp = sp->destructor;
fprintf(out,"{\n"); (*lineno)++; 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 ){ }else if( lemp->vardest ){
cp = lemp->vardest; cp = lemp->vardest;
if( cp==0 ) return; if( cp==0 ) return;
@ -3510,13 +3518,19 @@ PRIVATE void emit_code(
/* Generate code to do the reduce action */ /* Generate code to do the reduce action */
if( rp->code ){ 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); fprintf(out,"{%s",rp->code);
for(cp=rp->code; *cp; cp++){ for(cp=rp->code; *cp; cp++){
if( *cp=='\n' ) (*lineno)++; if( *cp=='\n' ) (*lineno)++;
} /* End loop */ } /* End loop */
fprintf(out,"}\n"); (*lineno)++; 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 ) */ } /* End if( rp->code ) */
return; return;