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

Function group_operator

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

Source from the content-addressed store, hash-verified

290
291
292def group_operator(tlist):
293 ttypes = T_NUMERICAL + T_STRING + T_NAME
294 sqlcls = (sql.SquareBrackets, sql.Parenthesis, sql.Function,
295 sql.Identifier, sql.Operation, sql.TypedLiteral)
296
297 def match(token):
298 return imt(token, t=(T.Operator, T.Wildcard))
299
300 def valid(token):
301 return imt(token, i=sqlcls, t=ttypes) \
302 or (token and token.match(
303 T.Keyword,
304 ('CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP')))
305
306 def post(tlist, pidx, tidx, nidx):
307 tlist[tidx].ttype = T.Operator
308 return pidx, nidx
309
310 valid_prev = valid_next = valid
311 _group(tlist, sql.Operation, match,
312 valid_prev, valid_next, post, extend=False)
313
314
315def group_identifier_list(tlist):

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…