Unused.foreign: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/suspicious/unused.bend as Unused Lines 74-85 of bolt@1.27.0.0/src/rules/suspicious/unused.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/rules/suspicious/unused.bend&start_line=74&end_line=85 import Base import bolt@1.27.0.0/src/syntax/tree.bend as Tree # every header line of the defs whose body is `import "./x.c"`, wherever the # header's `->` and return type fall def foreign(root: Tree.Node) -> List<&2, U32>: match root: case Tree.NCons{Tree.Stmt{Tree.SDef{}, +kids, body}, rest}: +more = foreign(rest) +own = lines(Tree.leaves(kids), more) Bool.pick(List<&2, U32>, foreign.opens(body, Bool.not(foreign.ends(kids, False{}))), own, more) case Tree.NCons{other, rest}: foreign(rest) case other: Nil{} Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not 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=U32 https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/suspicious/unused.bend&name=foreign.ends https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/suspicious/unused.bend&name=foreign.opens https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/suspicious/unused.bend&name=lines 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=leaves