diff options
author | danielk1977 <danielk1977@noemail.net> | 2005-01-31 12:42:29 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2005-01-31 12:42:29 +0000 |
commit | c60e9b82db7bdc9d323acbb0cec6d4f03973a763 (patch) | |
tree | 4d2950ea373ed749325a090b3cb0f86a37ff54e0 /src/tokenize.c | |
parent | d5b6b38d6fd828df49d6b5377b47348ba0be583f (diff) | |
download | sqlite-c60e9b82db7bdc9d323acbb0cec6d4f03973a763.tar.gz sqlite-c60e9b82db7bdc9d323acbb0cec6d4f03973a763.zip |
Assorted minor changes to speed up loading the database schema. (CVS 2293)
FossilOrigin-Name: dfbd684a913022ad43ce59c3422d3d94f776d547
Diffstat (limited to 'src/tokenize.c')
-rw-r--r-- | src/tokenize.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/tokenize.c b/src/tokenize.c index 43490cbeb..4fc1d3d7c 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -15,7 +15,7 @@ ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** -** $Id: tokenize.c,v 1.99 2005/01/18 04:00:44 drh Exp $ +** $Id: tokenize.c,v 1.100 2005/01/31 12:42:29 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -71,7 +71,7 @@ static const char isIdChar[] = { ** Return the length of the token that begins at z[0]. ** Store the token type in *tokenType before returning. */ -int sqlite3GetToken(const unsigned char *z, int *tokenType){ +static int getToken(const unsigned char *z, int *tokenType){ int i, c; switch( *z ){ case ' ': case '\t': case '\n': case '\f': case '\r': { @@ -309,13 +309,16 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ break; } for(i=1; IdChar(z[i]); i++){} - *tokenType = sqlite3KeywordCode((char*)z, i); + *tokenType = keywordCode((char*)z, i); return i; } } *tokenType = TK_ILLEGAL; return 1; } +int sqlite3GetToken(const unsigned char *z, int *tokenType){ + return getToken(z, tokenType); +} /* ** Run the parser on the given SQL string. The parser structure is @@ -355,7 +358,7 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){ assert( i>=0 ); pParse->sLastToken.z = &zSql[i]; assert( pParse->sLastToken.dyn==0 ); - pParse->sLastToken.n = sqlite3GetToken((unsigned char*)&zSql[i],&tokenType); + pParse->sLastToken.n = getToken((unsigned char*)&zSql[i],&tokenType); i += pParse->sLastToken.n; switch( tokenType ){ case TK_SPACE: |