Pick.search.reads: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/correctness/pick.bend as Pick Lines 133-149 of bolt@1.27.0.0/src/rules/correctness/pick.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/rules/correctness/pick.bend&start_line=133&end_line=149 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 # does a name leaf under the node spell xx? def search.reads(nn: Tree.Node, +xx: String) -> Bool: match nn: case Tree.Leaf{Lex.Tok{k, +t, _l, _c}}: Bool.and(Lex.is_name(k), String.eq(t, xx)) case Tree.Group{_o, kids, _cl}: search.reads(kids, xx) case Tree.Stmt{_k, kids, body}: +a = search.reads(kids, xx) +b = search.reads(body, xx) Bool.or(a, b) case Tree.NCons{h, t}: +a = search.reads(h, xx) +b = search.reads(t, xx) Bool.or(a, b) case Tree.NNil{}: False{} Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq 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/lex.bend&name=is_name https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/tree.bend&name=Node