summaryrefslogtreecommitdiff
path: root/sqlparse
diff options
context:
space:
mode:
Diffstat (limited to 'sqlparse')
-rw-r--r--sqlparse/engine/grouping.py3
-rw-r--r--sqlparse/sql.py4
2 files changed, 4 insertions, 3 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py
index bf76119..86c4bf2 100644
--- a/sqlparse/engine/grouping.py
+++ b/sqlparse/engine/grouping.py
@@ -195,7 +195,8 @@ def group_comments(tlist):
token = tlist.token_next_by(t=T.Comment)
while token:
end = tlist.token_not_matching(
- tlist.token_index(token) + 1, lambda tk: imt(tk, t=T.Comment) or tk.is_whitespace())
+ lambda tk: imt(tk, t=T.Comment) or tk.is_whitespace(),
+ idx=tlist.token_index(token) + 1)
if end is not None:
end = tlist.token_prev(tlist.token_index(end), False)
token = tlist.group_tokens_between(sql.Comment, token, end)
diff --git a/sqlparse/sql.py b/sqlparse/sql.py
index 027228d..e0ac81d 100644
--- a/sqlparse/sql.py
+++ b/sqlparse/sql.py
@@ -269,12 +269,12 @@ class TokenList(Token):
funcs = lambda tk: imt(tk, i, m, t)
return self._token_matching(funcs, idx, end)
- def token_not_matching(self, idx, funcs):
+ def token_not_matching(self, funcs, idx):
funcs = (funcs,) if not isinstance(funcs, (list, tuple)) else funcs
funcs = [lambda tk: not func(tk) for func in funcs]
return self._token_matching(funcs, idx)
- def token_matching(self, idx, funcs):
+ def token_matching(self, funcs, idx):
return self._token_matching(funcs, idx)
def token_idx_prev(self, idx, skip_ws=True):