diff options
author | drh <drh@noemail.net> | 2014-07-24 12:19:41 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-07-24 12:19:41 +0000 |
commit | c4747f231496c0169c1304bed83c9cc690193ef5 (patch) | |
tree | 6a528fb4fae701d04d86a03ef856fe392fff0955 /src/tokenize.c | |
parent | 6976c2123b6498e6e5744a8be4caa4fa62de8906 (diff) | |
parent | 3b9fab1cb9239e1ed0c17d695a45d467c826aa80 (diff) | |
download | sqlite-c4747f231496c0169c1304bed83c9cc690193ef5.tar.gz sqlite-c4747f231496c0169c1304bed83c9cc690193ef5.zip |
Add support for hexadecimal integer literals in the parser.
FossilOrigin-Name: f8f79f28785db716b10c3bc9d6652b98253fd125
Diffstat (limited to 'src/tokenize.c')
-rw-r--r-- | src/tokenize.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tokenize.c b/src/tokenize.c index 87553e25b..4017c3b81 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -270,6 +270,12 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ testcase( z[0]=='6' ); testcase( z[0]=='7' ); testcase( z[0]=='8' ); testcase( z[0]=='9' ); *tokenType = TK_INTEGER; +#ifndef SQLITE_OMIT_HEX_INTEGER + if( z[0]=='0' && (z[1]=='x' || z[1]=='X') && sqlite3Isxdigit(z[2]) ){ + for(i=3; sqlite3Isxdigit(z[i]); i++){} + return i; + } +#endif for(i=0; sqlite3Isdigit(z[i]); i++){} #ifndef SQLITE_OMIT_FLOATING_POINT if( z[i]=='.' ){ |