def search.walk
bolt@1.27.0.0 · src/rules/correctness/pick.bend:350
import bolt@1.27.0.0/src/rules/correctness/pick.bend as Pick
import Base
import bolt@1.27.0.0/src/finding.bend as F
import bolt@1.27.0.0/src/syntax/tree.bend as Tree
350
351
352def search.walk(nn: Tree.Node, +name: String, +path: String) -> List<&2, F.Finding>:
353 match nn:
354 case Tree.NCons{Tree.Stmt{kind, kids, body}, +rest}:
355 List.concat(&2, F.Finding, [search.stmt(kind, kids, rest, name, path), search.walk(body, name, path),
356 search.walk(rest, name, path)])
357 case Tree.NCons{_h, rest}:
358 search.walk(rest, name, path)
359 case _other:
360 Nil{}