Concat.cwalk: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/suspicious/concat.bend as Concat Lines 347-369 of bolt@1.27.0.0/src/rules/suspicious/concat.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/rules/suspicious/concat.bend&start_line=347&end_line=369 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 import bolt@1.27.0.0/src/rules/calls.bend as Calls import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy # every continuation call's arguments, with the lets in scope def cwalk( nn: Tree.Node, +conts: List<&2, String>, +accs: List<&2, String>, +lets: List<&2, Let>, +path: String ) -> List<&2, F.Finding>: match nn: case Tree.NCons{Tree.Leaf{Lex.Tok{k, +t, l, c}}, Tree.NCons{Tree.Group{Lex.Tok{_, +o, _, _}, +kids, _}, rest}}: +me = Bool.and(String.eq(o, "("), List.contains(~String, ~String.eq, conts, t)) List.concat(&2, F.Finding, [ Lazy.stop(List<&2, F.Finding>, Bool.not(me), [], _u => hits.cont(Calls.args(kids), accs, lets, path, [])), cwalk(kids, conts, accs, lets, path), cwalk(rest, conts, accs, lets, path)]) case Tree.NCons{Tree.Group{open, kids, close}, rest}: List.concat(&2, F.Finding, [cwalk(kids, conts, accs, lets, path), cwalk(rest, conts, accs, lets, path)]) case Tree.NCons{Tree.Stmt{kind, +kids, body}, rest}: List.concat(&2, F.Finding, [cwalk(kids, conts, accs, lets, path), cwalk(body, conts, accs, lets, path), cwalk(rest, conts, accs, after(kind, kids, lets), path)]) case Tree.NCons{h, rest}: cwalk(rest, conts, accs, lets, path) case other: Nil{} Uses (15): 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.not 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=List.contains 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/finding.bend&name=Finding https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lazy/lazy.bend&name=stop https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/calls.bend&name=args https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/suspicious/concat.bend&name=Let https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/suspicious/concat.bend&name=after https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/suspicious/concat.bend&name=hits.cont 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