From 3ecc05bc3fb414a0a184b4d69d5ecc38ddb24951 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 12 Dec 2019 00:20:40 +0000 Subject: [PATCH] Fix goofy string formatting in lemon.c that dates from the K&R-C days. FossilOrigin-Name: 48ba5e5a2227257cebafacbb09e9dd91d9b89ab2d52a8b4e4113c1d017d95f41 --- manifest | 12 ++++++------ manifest.uuid | 2 +- tool/lemon.c | 30 ++++++++++++++++-------------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/manifest b/manifest index 7f92b1663a..804a68c4d3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improved\stracing\soutput\sfrom\sthe\sLEMON-generated\sparser. -D 2019-12-11T18:53:51.696 +C Fix\sgoofy\sstring\sformatting\sin\slemon.c\sthat\sdates\sfrom\sthe\sK&R-C\sdays. +D 2019-12-12T00:20:40.700 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1771,7 +1771,7 @@ F tool/genfkey.test b6afd7b825d797a1e1274f519ab5695373552ecad5cd373530c63533638a F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce F tool/index_usage.c 9ec344d29cbeb03fdc0fce668eedfb7495792170de933adf95cf8d6904a166ad F tool/kvtest-speed.sh 4761a9c4b3530907562314d7757995787f7aef8f -F tool/lemon.c a53b48e03bdfb31d8b94ee0a8c5a88b2716d77e8b6bbf9ff8be276a8ce61ada5 +F tool/lemon.c 50f9d1896ba141bffca6929317f54f63709d00d3ac82bc5c189d9c9c0a83e832 F tool/lempar.c e8899b28488f060d0ff931539ea6311b16b22dce068c086c788a06d5e8d01ab7 F tool/libvers.c caafc3b689638a1d88d44bc5f526c2278760d9b9 F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862 @@ -1852,7 +1852,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 840de36df1aaeb4bad9a7c18e97cc560ba3b8c629c4520a05bc456d67b3347b9 -R 5b7b3da1e783e19bee64e818c1bade2d +P 4d6d2fc046d586a1e5989bbb2757f13d0371fbfad0acf45a0e2fd77dffd8d8f9 +R 5e026b3cfa5e818c2e50f705eaa7c6b6 U drh -Z 28a547edacf915c474b62de15b3656cb +Z d2668f11b5269bc264b434444e0b4796 diff --git a/manifest.uuid b/manifest.uuid index d7eae7997f..433b215c3e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4d6d2fc046d586a1e5989bbb2757f13d0371fbfad0acf45a0e2fd77dffd8d8f9 \ No newline at end of file +48ba5e5a2227257cebafacbb09e9dd91d9b89ab2d52a8b4e4113c1d017d95f41 \ No newline at end of file diff --git a/tool/lemon.c b/tool/lemon.c index 0a7b05a928..0e717e1afa 100644 --- a/tool/lemon.c +++ b/tool/lemon.c @@ -910,9 +910,9 @@ void FindStates(struct lemon *lemp) sp = Symbol_find(lemp->start); if( sp==0 ){ ErrorMsg(lemp->filename,0, -"The specified start symbol \"%s\" is not \ -in a nonterminal of the grammar. \"%s\" will be used as the start \ -symbol instead.",lemp->start,lemp->startRule->lhs->name); + "The specified start symbol \"%s\" is not " + "in a nonterminal of the grammar. \"%s\" will be used as the start " + "symbol instead.",lemp->start,lemp->startRule->lhs->name); lemp->errorcnt++; sp = lemp->startRule->lhs; } @@ -928,9 +928,9 @@ symbol instead.",lemp->start,lemp->startRule->lhs->name); for(i=0; inrhs; i++){ if( rp->rhs[i]==sp ){ /* FIX ME: Deal with multiterminals */ ErrorMsg(lemp->filename,0, -"The start symbol \"%s\" occurs on the \ -right-hand side of a rule. This will result in a parser which \ -does not work properly.",sp->name); + "The start symbol \"%s\" occurs on the " + "right-hand side of a rule. This will result in a parser which " + "does not work properly.",sp->name); lemp->errorcnt++; } } @@ -2274,13 +2274,13 @@ static void parseonetoken(struct pstate *psp) }else if( x[0]=='{' ){ if( psp->prevrule==0 ){ ErrorMsg(psp->filename,psp->tokenlineno, -"There is no prior rule upon which to attach the code \ -fragment which begins on this line."); + "There is no prior rule upon which to attach the code " + "fragment which begins on this line."); psp->errorcnt++; }else if( psp->prevrule->code!=0 ){ ErrorMsg(psp->filename,psp->tokenlineno, -"Code fragment beginning on this line is not the first \ -to follow the previous rule."); + "Code fragment beginning on this line is not the first " + "to follow the previous rule."); psp->errorcnt++; }else if( strcmp(x, "{NEVER-REDUCE")==0 ){ psp->prevrule->neverReduce = 1; @@ -2309,8 +2309,8 @@ to follow the previous rule."); psp->errorcnt++; }else if( psp->prevrule->precsym!=0 ){ ErrorMsg(psp->filename,psp->tokenlineno, -"Precedence mark on this line is not the first \ -to follow the previous rule."); + "Precedence mark on this line is not the first " + "to follow the previous rule."); psp->errorcnt++; }else{ psp->prevrule->precsym = Symbol_new(x); @@ -2913,7 +2913,8 @@ void Parse(struct lemon *gp) } if( c==0 ){ ErrorMsg(ps.filename,startline, -"String starting on this line is not terminated before the end of the file."); + "String starting on this line is not terminated before " + "the end of the file."); ps.errorcnt++; nextcp = cp; }else{ @@ -2952,7 +2953,8 @@ void Parse(struct lemon *gp) } if( c==0 ){ ErrorMsg(ps.filename,ps.tokenlineno, -"C code starting on this line is not terminated before the end of the file."); + "C code starting on this line is not terminated before " + "the end of the file."); ps.errorcnt++; nextcp = cp; }else{ -- 2.47.2