diff options
author | Andi Albrecht <albrecht.andi@gmail.com> | 2013-10-23 20:48:07 -0700 |
---|---|---|
committer | Andi Albrecht <albrecht.andi@gmail.com> | 2013-10-23 20:48:07 -0700 |
commit | 6efac742ec8505734432dbb1e6fb50d188369fac (patch) | |
tree | 64247b6c5311cc6b82bb12b0f424bcb5d048c557 | |
parent | 2aa7f0c68f5ba77b347e216994fd01be63e8aeb0 (diff) | |
parent | 8168e84a424711aa456e8e5c0cf646bcce291abe (diff) | |
download | sqlparse-6efac742ec8505734432dbb1e6fb50d188369fac.tar.gz |
Merge pull request #112 from alexander-beedie/master
extended JOIN token recognition/lexing (eg: FULL OUTER JOIN, NATURAL JOIN)
-rw-r--r-- | sqlparse/keywords.py | 1 | ||||
-rw-r--r-- | sqlparse/lexer.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py index 892badf..bbf3c6b 100644 --- a/sqlparse/keywords.py +++ b/sqlparse/keywords.py @@ -550,6 +550,7 @@ KEYWORDS_COMMON = { 'ORDER': tokens.Keyword, 'LEFT': tokens.Keyword, 'OUTER': tokens.Keyword, + 'FULL': tokens.Keyword, 'IF': tokens.Keyword, 'END': tokens.Keyword, diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py index a8e66f9..d69c938 100644 --- a/sqlparse/lexer.py +++ b/sqlparse/lexer.py @@ -195,7 +195,7 @@ class Lexer(object): # not a real string literal in ANSI SQL: (r'(""|".*?[^\\]")', tokens.String.Symbol), (r'(\[.*[^\]]\])', tokens.Name), - (r'(LEFT\s+|RIGHT\s+)?(INNER\s+|OUTER\s+|STRAIGHT\s+)?JOIN\b', tokens.Keyword), + (r'((LEFT\s+|RIGHT\s+|FULL\s+)?(INNER\s+|OUTER\s+|STRAIGHT\s+)?|(CROSS\s+|NATURAL\s+)?)?JOIN\b', tokens.Keyword), (r'END(\s+IF|\s+LOOP)?\b', tokens.Keyword), (r'NOT NULL\b', tokens.Keyword), (r'CREATE(\s+OR\s+REPLACE)?\b', tokens.Keyword.DDL), |