Rewalk.gather: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/pedantic/rewalk.bend as Rewalk Lines 558-576 of bolt@1.27.0.0/src/rules/pedantic/rewalk.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/rules/pedantic/rewalk.bend&start_line=558&end_line=576 import Base import bolt@1.27.0.0/src/syntax/lex.bend as Lex import bolt@1.27.0.0/src/syntax/tree.bend as Tree # every expensive call, wide unless the call is indexed on the spot; its # arguments are their text and which let of each name they read def gather(nn: Tree.Node, +self: String, +lp: List<&2, String>, +bs: List<&2, Bind>) -> List<&2, Site>: match nn: case Tree.NCons{Tree.Leaf{Lex.Tok{k, +t, +l, +c}}, Tree.NCons{Tree.Group{Lex.Tok{_, +o, _, _}, +kids, _}, +rest}}: +args = Tree.show(kids) ++ stamp(names(kids, []), bs, l, c) +here = open_site(String.eq(o, "("), indexed(rest), t, args, l, c, U32.from_nat(String.length(t)), self, lp) List.concat(&2, Site, [here, gather(kids, self, lp, bs), gather(rest, self, lp, bs)]) case Tree.NCons{Tree.Group{open, +kids, close}, rest}: List.concat(&2, Site, [gather(kids, self, lp, bs), gather(rest, self, lp, bs)]) case Tree.NCons{Tree.Stmt{Tree.SCase{}, +kids, body}, rest}: List.concat(&2, Site, [gather(kids, self, lp, bs), gather(rest, self, lp, bs)]) case Tree.NCons{Tree.Stmt{kind, +kids, body}, rest}: List.concat(&2, Site, [gather(kids, self, lp, bs), gather(body, self, lp, bs), gather(rest, self, lp, bs)]) case Tree.NCons{h, rest}: gather(rest, self, lp, bs) case other: Nil{} Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.concat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/pedantic/rewalk.bend&name=Bind https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/pedantic/rewalk.bend&name=Site https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/pedantic/rewalk.bend&name=indexed https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/pedantic/rewalk.bend&name=names https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/pedantic/rewalk.bend&name=open_site https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/pedantic/rewalk.bend&name=stamp https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/lex.bend&name=Tok https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/tree.bend&name=Node https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/tree.bend&name=StmtKind https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/tree.bend&name=show