diff options
| author | Victor Uriarte <victor.m.uriarte@intel.com> | 2016-06-03 11:32:15 -0700 |
|---|---|---|
| committer | Victor Uriarte <victor.m.uriarte@intel.com> | 2016-06-04 11:54:20 -0700 |
| commit | cca348e295fc2e00c745d3a8c1bac3e8d4a5d97e (patch) | |
| tree | b99ec3fd32d66d4b0ef960ef355374c8332bb5ef /sqlparse/keywords.py | |
| parent | 2fcbee71724dd6311afe5a88106c4591bc1914ee (diff) | |
| download | sqlparse-cca348e295fc2e00c745d3a8c1bac3e8d4a5d97e.tar.gz | |
Refactor regex Func/keyword exceptions together
Diffstat (limited to 'sqlparse/keywords.py')
| -rw-r--r-- | sqlparse/keywords.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py index 9c4495b..fb2f042 100644 --- a/sqlparse/keywords.py +++ b/sqlparse/keywords.py @@ -31,7 +31,6 @@ SQL_REGEX = { (r'\*', tokens.Wildcard), - (r'CASE\b', tokens.Keyword), # extended CASE(foo) (r"`(``|[^`])*`", tokens.Name), (r"´(´´|[^´])*´", tokens.Name), (r'\$([^\W\d]\w*)?\$', tokens.Name.Builtin), @@ -42,12 +41,11 @@ SQL_REGEX = { # FIXME(andi): VALUES shouldn't be listed here # 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'USING(?=\()', tokens.Keyword), + (r'(CASE|IN|VALUES|USING)\b', tokens.Keyword), + + (r'(@|##|#)[^\W\d_]\w+', tokens.Name), (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), |
