summaryrefslogtreecommitdiff
path: root/sqlparse
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2011-09-29 09:33:47 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2011-09-29 09:33:47 +0200
commitff50b33074f5c276b0cff8094e85582dcd467095 (patch)
tree6f34a60f9d7b62530bb65dfe0c4d7be8eb45abf7 /sqlparse
parentf811fa12247330adc27f1b842167a112b1c0829c (diff)
downloadsqlparse-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')
-rw-r--r--sqlparse/lexer.py1
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),
],