diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2015-04-12 07:37:01 +0200 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2015-04-12 07:37:01 +0200 |
| commit | f775030692222a5a0b296284328276b65259cc02 (patch) | |
| tree | a04aee084828f9389b870fc68614f1fa86c3b21c /sqlparse | |
| parent | ab827eaf935aba776715c4693ec9f320008a6708 (diff) | |
| download | sqlparse-f775030692222a5a0b296284328276b65259cc02.tar.gz | |
Never interpret IN keyword as function name (fixes #183).
Diffstat (limited to 'sqlparse')
| -rw-r--r-- | sqlparse/lexer.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py index a1a4703..9533e8a 100644 --- a/sqlparse/lexer.py +++ b/sqlparse/lexer.py @@ -186,6 +186,9 @@ class Lexer(object): # see https://github.com/andialbrecht/sqlparse/pull/64 (r'VALUES', tokens.Keyword), (r'@[^\W\d_]\w+', tokens.Name), + # IN is special, it may be followed by a parenthesis, but + # is never a functino, see issue183 + (r'in\b(?=[ (])?', tokens.Keyword), (r'[^\W\d_]\w*(?=[.(])', tokens.Name), # see issue39 (r'[-]?0x[0-9a-fA-F]+', tokens.Number.Hexadecimal), (r'[-]?[0-9]*(\.[0-9]+)?[eE][-]?[0-9]+', tokens.Number.Float), |
