From ff50b33074f5c276b0cff8094e85582dcd467095 Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Thu, 29 Sep 2011 09:33:47 +0200 Subject: 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. --- sqlparse/lexer.py | 1 + 1 file changed, 1 insertion(+) (limited to 'sqlparse') 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), ], -- cgit v1.2.1