Group together Identifier and Asc/Desc token
(tlist)
| 406 | |
| 407 | @recurse(sql.Identifier) |
| 408 | def group_order(tlist): |
| 409 | """Group together Identifier and Asc/Desc token""" |
| 410 | tidx, token = tlist.token_next_by(t=T.Keyword.Order) |
| 411 | while token: |
| 412 | pidx, prev_ = tlist.token_prev(tidx) |
| 413 | if imt(prev_, i=sql.Identifier, t=T.Number): |
| 414 | tlist.group_tokens(sql.Identifier, pidx, tidx) |
| 415 | tidx = pidx |
| 416 | tidx, token = tlist.token_next_by(t=T.Keyword.Order, idx=tidx) |
| 417 | |
| 418 | |
| 419 | @recurse() |
nothing calls this directly
no test coverage detected
searching dependent graphs…