Thunk.walk: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/suspicious/thunk.bend as Thunk Lines 147-160 of bolt@1.27.0.0/src/rules/suspicious/thunk.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/rules/suspicious/thunk.bend&start_line=147&end_line=160 import Base import bolt@1.27.0.0/src/finding.bend as F 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 thunk of a self-call under the node, at any depth; lone: the node is # the rest of the kids of a call given exactly one lambda def walk(nn: Tree.Node, +lone: Bool, +name: String, +path: String) -> List<&2, F.Finding>: match nn: case Tree.NCons{+h, +rest}: +here = site(h, rest, name, path) List.concat(&2, F.Finding, [Bool.pick(List<&2, F.Finding>, lone, here, []), walk(h, False{}, name, path), walk(rest, lone, name, path)]) case Tree.Group{Lex.Tok{_k, +o, _l, _c}, +kids, _cl}: walk(kids, only(o, kids), name, path) case Tree.Stmt{_k, kids, body}: List.concat(&2, F.Finding, [walk(kids, False{}, name, path), walk(body, False{}, name, path)]) case _other: Nil{} Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick 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=bolt@1.27.0.0/src/finding.bend&name=Finding https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/suspicious/thunk.bend&name=only https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/suspicious/thunk.bend&name=site 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