diff options
author | Andi Albrecht <albrecht.andi@gmail.com> | 2013-06-17 08:10:06 +0200 |
---|---|---|
committer | Andi Albrecht <albrecht.andi@gmail.com> | 2013-06-17 08:10:06 +0200 |
commit | 91a9efe0511ab5b1c769d90c04b8b329fe3173ad (patch) | |
tree | 06afe43cacf672e77188340b9439749d831e974e /sqlparse/lexer.py | |
parent | c587a1042b52d49b36756f1d342656413956df62 (diff) | |
download | sqlparse-91a9efe0511ab5b1c769d90c04b8b329fe3173ad.tar.gz |
Allow whitespaces in certain keywords (fixes #97).
Diffstat (limited to 'sqlparse/lexer.py')
-rw-r--r-- | sqlparse/lexer.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py index b981c0e..8b61fc1 100644 --- a/sqlparse/lexer.py +++ b/sqlparse/lexer.py @@ -196,10 +196,10 @@ class Lexer(object): # not a real string literal in ANSI SQL: (r'(""|".*?[^\\]")', tokens.String.Symbol), (r'(\[.*[^\]]\])', tokens.Name), - (r'(LEFT |RIGHT )?(INNER |OUTER |STRAIGHT)?JOIN\b', tokens.Keyword), - (r'END( IF| LOOP)?\b', tokens.Keyword), + (r'(LEFT\s+|RIGHT\s+)?(INNER\s+|OUTER\s+|STRAIGHT\s+)?JOIN\b', tokens.Keyword), + (r'END(\s+IF|\s+LOOP)?\b', tokens.Keyword), (r'NOT NULL\b', tokens.Keyword), - (r'CREATE( OR REPLACE)?\b', tokens.Keyword.DDL), + (r'CREATE(\s+OR\s+REPLACE)?\b', tokens.Keyword.DDL), (r'(?<=\.)[^\W\d_]\w*', tokens.Name), (r'[^\W\d_]\w*', is_keyword), (r'[;:()\[\],\.]', tokens.Punctuation), |