def group_order(tlist):
 (tidx, token) = tlist.token_next_by(t=T.Keyword.Order)
 while token:
  (pidx, prev_) = tlist.token_prev(tidx)
  if imt(prev_, i=sql.Identifier, t=T.Number):
   tlist.group_tokens(sql.Identifier, pidx, tidx)
   tidx = pidx
  (tidx, token) = tlist.token_next_by(t=T.Keyword.Order, idx=tidx)

def group_order ( tlist ) : ( tidx , token ) = tlist . token_next_by ( t = T . Keyword . Order ) while token : ( pidx , prev_ ) = tlist . token_prev ( tidx ) if imt ( prev_ , i = sql . Identifier , t = T . Number ) : tlist . group_tokens ( sql . Identifier , pidx , tidx ) tidx = pidx ( tidx , token ) = tlist . token_next_by ( t = T . Keyword . Order , idx = tidx )
group together identifier and asc/desc token .