(tlist)
| 226 | |
| 227 | |
| 228 | def 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) |
nothing calls this directly
no test coverage detected
searching dependent graphs…