def alias.go
import bend-lint-rules@0.2.0.0/layout/format.bend as Formatimport Base
2147def alias.go(s: String, hit: Bool, acc: String) -> String:
2148 match s hit:
2149 case SNil{} _:
2150 String.reverse(acc)
2151 case SCon{c, rest} True{}:
2152 String.reverse(acc) ++ " as " ++ drop_blank(String.drop(drop_blank(SCon{c, rest}), 2n))
2153 case SCon{c, +rest} False{}:
2154 alias.go(rest, is_alias_at(rest), SCon{c, acc})