From 581912d36e2b10191e46fa891dce912693983c95 Mon Sep 17 00:00:00 2001 From: Victor Uriarte Date: Thu, 16 Jun 2016 06:45:09 -0700 Subject: Misc. small code clean-up/comments --- sqlparse/engine/grouping.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sqlparse/engine') diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index 62f37a6..d5b5c4f 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -217,14 +217,13 @@ def group_operator(tlist): def group_identifier_list(tlist): m_role = T.Keyword, ('null', 'role') - m_comma = T.Punctuation, ',' sqlcls = (sql.Function, sql.Case, sql.Identifier, sql.Comparison, sql.IdentifierList, sql.Operation) ttypes = (T_NUMERICAL + T_STRING + T_NAME + (T.Keyword, T.Comment, T.Wildcard)) def match(token): - return imt(token, m=m_comma) + return token.match(T.Punctuation, ',') def valid(token): return imt(token, i=sqlcls, m=m_role, t=ttypes) @@ -275,7 +274,7 @@ def group_aliased(tlist): tidx, token = tlist.token_next_by(i=I_ALIAS, t=T.Number) while token: nidx, next_ = tlist.token_next(tidx) - if imt(next_, i=sql.Identifier): + if isinstance(next_, sql.Identifier): tlist.group_tokens(sql.Identifier, tidx, nidx, extend=True) tidx, token = tlist.token_next_by(i=I_ALIAS, t=T.Number, idx=tidx) -- cgit v1.2.1