summaryrefslogtreecommitdiff
path: root/sqlparse
diff options
context:
space:
mode:
authorVictor Uriarte <victor.m.uriarte@intel.com>2016-06-15 13:59:29 -0700
committerVictor Uriarte <victor.m.uriarte@intel.com>2016-06-15 14:05:08 -0700
commit228059eb4da5ed2389fc7e987dba37c6d05ea3ea (patch)
tree6e842c4687f12e39409ad4765827b19b82498567 /sqlparse
parentd6763dc7592f6e60c3e2e712b39a1b865fc8485e (diff)
downloadsqlparse-228059eb4da5ed2389fc7e987dba37c6d05ea3ea.tar.gz
remove group left_right
Diffstat (limited to 'sqlparse')
-rw-r--r--sqlparse/engine/grouping.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py
index 2148b50..b2b46bb 100644
--- a/sqlparse/engine/grouping.py
+++ b/sqlparse/engine/grouping.py
@@ -63,33 +63,6 @@ def group_begin(tlist):
_group_matching(tlist, sql.Begin)
-def _group_left_right(tlist, m, cls,
- valid_left=lambda t: t is not None,
- valid_right=lambda t: t is not None,
- semicolon=False):
- """Groups together tokens that are joined by a middle token. ie. x < y"""
- for token in list(tlist):
- if token.is_group() and not isinstance(token, cls):
- _group_left_right(token, m, cls, valid_left, valid_right,
- semicolon)
- continue
- if not token.match(*m):
- continue
-
- tidx = tlist.token_index(token)
- pidx, prev_ = tlist.token_prev(tidx)
- nidx, next_ = tlist.token_next(tidx)
-
- if valid_left(prev_) and valid_right(next_):
- if semicolon:
- # only overwrite if a semicolon present.
- m_semicolon = T.Punctuation, ';'
- snidx, _ = tlist.token_next_by(m=m_semicolon, idx=nidx)
- nidx = snidx or nidx
- # Luckily, this leaves the position of `token` intact.
- tlist.group_tokens(cls, pidx, nidx, extend=True)
-
-
def group_typecasts(tlist):
def match(token):
return token.match(T.Punctuation, '::')