Thunk.reads: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/suspicious/thunk.bend as Thunk Lines 38-55 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=38&end_line=55 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 read the parameter: its text, or its text # then a dot? def reads(nn: Tree.Node, +pp: String) -> Bool: match nn: case Tree.Leaf{Lex.Tok{k, +t, _l, _c}}: Bool.and(Lex.is_name(k), Bool.or(String.eq(t, pp), String.starts_with(t, pp ++ "."))) case Tree.Group{_o, kids, _cl}: reads(kids, pp) case Tree.Stmt{_k, kids, body}: +a = reads(kids, pp) +b = reads(body, pp) Bool.or(a, b) case Tree.NCons{h, t}: +a = reads(h, pp) +b = reads(t, pp) Bool.or(a, b) case Tree.NNil{}: False{} 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.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.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.starts_with 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