MCPcopy
hub / github.com/andialbrecht/sqlparse / group_comparison

Function group_comparison

sqlparse/engine/grouping.py:228–249  ·  view source on GitHub ↗
(tlist)

Source from the content-addressed store, hash-verified

226
227
228def group_comparison(tlist):
229 sqlcls = (sql.Parenthesis, sql.Function, sql.Identifier,
230 sql.Operation, sql.TypedLiteral)
231 ttypes = T_NUMERICAL + T_STRING + T_NAME
232
233 def match(token):
234 return token.ttype == T.Operator.Comparison
235
236 def valid(token):
237 if imt(token, t=ttypes, i=sqlcls):
238 return True
239 elif token and token.is_keyword and token.normalized == 'NULL':
240 return True
241 else:
242 return False
243
244 def post(tlist, pidx, tidx, nidx):
245 return pidx, nidx
246
247 valid_prev = valid_next = valid
248 _group(tlist, sql.Comparison, match,
249 valid_prev, valid_next, post, extend=False)
250
251
252@recurse(sql.Identifier)

Callers

nothing calls this directly

Calls 1

_groupFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…