1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Modify mkkeywordhash.c so that it puts the original text of each token in

a comment beside the "testcase()" macros. (CVS 6736)

FossilOrigin-Name: a7d0817c176832a88788cc973c0aae8dcab57364
This commit is contained in:
drh
2009-06-09 14:27:41 +00:00
parent 3b2a3fa42e
commit 9bb6697ac6
3 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Enable\scell\soverflow\schecking\sin\ssqlite3BtreeInitPage()\susing\sthe\ncompile-time\soption\sSQLITE_ENABLE_OVERSIZE_CELL_CHECK.\s\sChange\sthe\stests\nso\sthat\sthey\srecognize\sdifferent\serror\smessages\sdepending\son\sthe\ssetting\nof\sthis\smacro.\s(CVS\s6735)
D 2009-06-09T13:42:25
C Modify\smkkeywordhash.c\sso\sthat\sit\sputs\sthe\soriginal\stext\sof\seach\stoken\sin\na\scomment\sbeside\sthe\s"testcase()"\smacros.\s(CVS\s6736)
D 2009-06-09T14:27:41
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 8b8fb7823264331210cddf103831816c286ba446
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -715,7 +715,7 @@ F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
F tool/genfkey.test 405a43d54f1646bfaa7a84b03bb959aef62a3a49
F tool/lemon.c 1a94e70103e59f20df8f81539a453629df2aa523
F tool/lempar.c aeba88b8566ff66f8a67c96b3eb2dd95e7d8908d
F tool/mkkeywordhash.c 8e57fbe8c4fe2f1800f9190fd361231cb8558407
F tool/mkkeywordhash.c 511a848b2ac7a3d93f36adc1e1086b4c5741224b
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e x
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c.tcl 671833bd775e76ebd922b9e82c2508a344562511
@ -733,7 +733,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
P 2e5d42aeb40c3c6eea373a9ae3fbdf4e8087cd58
R d62552c29f49213fae384fb6619feacc
P 56bff6eb2fc5f0afbd96afc986671ec744bd40e1
R b6c6cb0746f9cab11932586981b7f888
U drh
Z 5d776a071c01e71a57d59767f05a68ee
Z f0c1b7aa48b811b9a2662ed5ac53ad57

View File

@ -1 +1 @@
56bff6eb2fc5f0afbd96afc986671ec744bd40e1
a7d0817c176832a88788cc973c0aae8dcab57364

View File

@ -6,6 +6,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
/*
** A header comment placed at the beginning of generated code.
@ -15,7 +16,7 @@ static const char zHdr[] =
"**\n"
"** The code in this file has been automatically generated by\n"
"**\n"
"** $Header: /home/drh/sqlite/trans/cvs/sqlite/sqlite/tool/mkkeywordhash.c,v 1.37 2009/02/01 00:00:46 drh Exp $\n"
"** $Header: /home/drh/sqlite/trans/cvs/sqlite/sqlite/tool/mkkeywordhash.c,v 1.38 2009/06/09 14:27:41 drh Exp $\n"
"**\n"
"** The code in this file implements a function that determines whether\n"
"** or not a given identifier is really an SQL keyword. The same thing\n"
@ -44,6 +45,7 @@ struct Keyword {
int iNext; /* Index in aKeywordTable[] of next with same hash */
int substrId; /* Id to another keyword this keyword is embedded in */
int substrOffset; /* Offset into substrId for start of this keyword */
char zOrigName[20]; /* Original keyword name before processing */
};
/*
@ -353,6 +355,8 @@ int main(int argc, char **argv){
for(i=0; i<nKeyword; i++){
Keyword *p = &aKeywordTable[i];
p->len = strlen(p->zName);
assert( p->len<sizeof(p->zOrigName) );
strcpy(p->zOrigName, p->zName);
totalLen += p->len;
p->hash = (UpperToLower[(int)p->zName[0]]*4) ^
(UpperToLower[(int)p->zName[p->len-1]]*3) ^ p->len;
@ -576,7 +580,7 @@ int main(int argc, char **argv){
" sqlite3StrNICmp(&zText[aOffset[i]],z,n)==0 ){\n");
for(i=0; i<nKeyword; i++){
printf(" testcase( i==%d ); /* %s */\n",
i, aKeywordTable[i].zTokenType);
i, aKeywordTable[i].zOrigName);
}
printf(" return aCode[i];\n");
printf(" }\n");