From 572b69c1e630506d81ef594b15febc37bb011318 Mon Sep 17 00:00:00 2001 From: Yago Riveiro Date: Thu, 25 Apr 2013 15:21:44 +0100 Subject: Added STRAIGHT_JOIN token. --- sqlparse/filters.py | 2 +- sqlparse/keywords.py | 1 + sqlparse/lexer.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'sqlparse') diff --git a/sqlparse/filters.py b/sqlparse/filters.py index fdb32ac..c6506eb 100644 --- a/sqlparse/filters.py +++ b/sqlparse/filters.py @@ -271,7 +271,7 @@ class ReindentFilter: return sql.Token(T.Whitespace, ws) def _split_kwds(self, tlist): - split_words = ('FROM', 'JOIN$', 'AND', 'OR', + split_words = ('FROM', 'STRAIGHT_JOIN$', 'JOIN$', 'AND', 'OR', 'GROUP', 'ORDER', 'UNION', 'VALUES', 'SET', 'BETWEEN') diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py index ed741d4..92a0b58 100644 --- a/sqlparse/keywords.py +++ b/sqlparse/keywords.py @@ -536,6 +536,7 @@ KEYWORDS_COMMON = { 'FROM': tokens.Keyword, 'INNER': tokens.Keyword, 'JOIN': tokens.Keyword, + 'STRAIGHT_JOIN': tokens.Keyword, 'AND': tokens.Keyword, 'OR': tokens.Keyword, 'LIKE': tokens.Keyword, diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py index 4d200a6..dd6ecc0 100644 --- a/sqlparse/lexer.py +++ b/sqlparse/lexer.py @@ -196,7 +196,7 @@ class Lexer(object): # not a real string literal in ANSI SQL: (r'(""|".*?[^\\]")', tokens.String.Symbol), (r'(\[.*[^\]]\])', tokens.Name), - (r'(LEFT |RIGHT )?(INNER |OUTER )?JOIN\b', tokens.Keyword), + (r'(LEFT |RIGHT )?(INNER |OUTER |STRAIGHT)?JOIN\b', tokens.Keyword), (r'END( IF| LOOP)?\b', tokens.Keyword), (r'NOT NULL\b', tokens.Keyword), (r'CREATE( OR REPLACE)?\b', tokens.Keyword.DDL), -- cgit v1.2.1