1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

:-) (CVS 82)

FossilOrigin-Name: 33355b2d8d23b51e917961b7fb336bc1d454497f
This commit is contained in:
drh
2000-06-08 16:26:24 +00:00
parent 4cfa793437
commit c837e70996
9 changed files with 167 additions and 34 deletions

View File

@@ -27,7 +27,7 @@
** individual tokens and sends those tokens one-by-one over to the
** parser for analysis.
**
** $Id: tokenize.c,v 1.10 2000/06/08 13:36:40 drh Exp $
** $Id: tokenize.c,v 1.11 2000/06/08 16:26:24 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -211,7 +211,7 @@ int sqliteGetToken(const char *z, int *tokenType){
case '!': {
if( z[1]!='=' ){
*tokenType = TK_ILLEGAL;
return 1;
return 2;
}else{
*tokenType = TK_NE;
return 2;
@@ -245,23 +245,23 @@ int sqliteGetToken(const char *z, int *tokenType){
}
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9': {
*tokenType = TK_INTEGER;
for(i=1; z[i] && isdigit(z[i]); i++){}
if( z[i]=='.' ){
i++;
while( z[i] && isdigit(z[i]) ){ i++; }
if( (z[i]=='e' || z[i]=='E') &&
*tokenType = TK_FLOAT;
}
if( (z[i]=='e' || z[i]=='E') &&
( isdigit(z[i+1])
|| ((z[i+1]=='+' || z[i+1]=='-') && isdigit(z[i+2]))
)
){
i += 2;
while( z[i] && isdigit(z[i]) ){ i++; }
}
){
i += 2;
while( z[i] && isdigit(z[i]) ){ i++; }
*tokenType = TK_FLOAT;
}else if( z[0]=='.' ){
*tokenType = TK_FLOAT;
}else{
*tokenType = TK_INTEGER;
}
return i;
}
@@ -363,8 +363,8 @@ int sqliteRunParser(Parse *pParse, char *zSql, char **pzErrMsg){
break;
}
case TK_ILLEGAL:
sqliteSetNString(pzErrMsg, "illegal token: \"", -1,
pParse->sLastToken.z, pParse->sLastToken.n, 0);
sqliteSetNString(pzErrMsg, "unrecognized token: \"", -1,
pParse->sLastToken.z, pParse->sLastToken.n, "\"", 1, 0);
nErr++;
break;
default: