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

Function group_comments

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

Source from the content-addressed store, hash-verified

335
336@recurse(sql.Comment)
337def group_comments(tlist):
338 tidx, token = tlist.token_next_by(t=T.Comment)
339 while token:
340 eidx, end = tlist.token_not_matching(
341 lambda tk: imt(tk, t=T.Comment) or tk.is_newline, idx=tidx)
342 if end is not None:
343 eidx, end = tlist.token_prev(eidx, skip_ws=False)
344 tlist.group_tokens(sql.Comment, tidx, eidx)
345
346 tidx, token = tlist.token_next_by(t=T.Comment, idx=tidx)
347
348
349@recurse(sql.Where)

Callers

nothing calls this directly

Calls 5

imtFunction · 0.90
token_next_byMethod · 0.80
token_not_matchingMethod · 0.80
token_prevMethod · 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…