Calls.calls: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/calls.bend as Calls Lines 119-137 of bolt@1.27.0.0/src/rules/calls.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/rules/calls.bend&start_line=119&end_line=137 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 # is there a call of the name, `name(..)`, anywhere under the node? def calls(nn: Tree.Node, +name: String) -> Bool: match nn: case Tree.NCons{Tree.Leaf{Lex.Tok{k, +t, l, c}}, Tree.NCons{Tree.Group{Lex.Tok{_, +o, _, _}, kids, _}, rest}}: +a = calls(kids, name) +b = calls(rest, name) Bool.or(Bool.and(String.eq(o, "("), String.eq(t, name)), Bool.or(a, b)) case Tree.Group{open, kids, close}: calls(kids, name) case Tree.Stmt{kind, kids, body}: +a = calls(kids, name) +b = calls(body, name) Bool.or(a, b) case Tree.NCons{h, t}: +a = calls(h, name) +b = calls(t, name) Bool.or(a, b) case other: False{} Uses (7): 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/tree.bend&name=Node