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

Function group_where

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

Source from the content-addressed store, hash-verified

348
349@recurse(sql.Where)
350def group_where(tlist):
351 tidx, token = tlist.token_next_by(m=sql.Where.M_OPEN)
352 while token:
353 eidx, end = tlist.token_next_by(m=sql.Where.M_CLOSE, idx=tidx)
354
355 if end is None:
356 end = tlist._groupable_tokens[-1]
357 else:
358 end = tlist.tokens[eidx - 1]
359 # TODO: convert this to eidx instead of end token.
360 # i think above values are len(tlist) and eidx-1
361 eidx = tlist.token_index(end)
362 tlist.group_tokens(sql.Where, tidx, eidx)
363 tidx, token = tlist.token_next_by(m=sql.Where.M_OPEN, idx=tidx)
364
365
366@recurse()

Callers

nothing calls this directly

Calls 3

token_next_byMethod · 0.80
token_indexMethod · 0.80
group_tokensMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…