diff options
author | Andi Albrecht <albrecht.andi@gmail.com> | 2011-09-29 09:33:47 +0200 |
---|---|---|
committer | Andi Albrecht <albrecht.andi@gmail.com> | 2011-09-29 09:33:47 +0200 |
commit | ff50b33074f5c276b0cff8094e85582dcd467095 (patch) | |
tree | 6f34a60f9d7b62530bb65dfe0c4d7be8eb45abf7 /sqlparse/lexer.py | |
parent | f811fa12247330adc27f1b842167a112b1c0829c (diff) | |
download | sqlparse-ff50b33074f5c276b0cff8094e85582dcd467095.tar.gz |
Make keyword detection more restrict (fixes issue47).
Keywords most likely don't follow dots. Maybe there are other
exclusions too, but for now let's just go with this one.
Diffstat (limited to 'sqlparse/lexer.py')
-rw-r--r-- | sqlparse/lexer.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py index 8929e3e..e90cd64 100644 --- a/sqlparse/lexer.py +++ b/sqlparse/lexer.py @@ -194,6 +194,7 @@ class Lexer(object): (r'END( IF| LOOP)?\b', tokens.Keyword), (r'NOT NULL\b', tokens.Keyword), (r'CREATE( OR REPLACE)?\b', tokens.Keyword.DDL), + (r'(?<=\.)[a-zA-Z_][a-zA-Z0-9_]*', tokens.Name), (r'[a-zA-Z_][a-zA-Z0-9_]*', is_keyword), (r'[;:()\[\],\.]', tokens.Punctuation), ], |