(tlist)
| 290 | |
| 291 | |
| 292 | def 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 | |
| 315 | def group_identifier_list(tlist): |
nothing calls this directly
no test coverage detected
searching dependent graphs…