def check.go
bolt@1.27.0.0 · src/rules/pedantic/index.bend:67
import bolt@1.27.0.0/src/rules/pedantic/index.bend as Index
import Base
import bolt@1.27.0.0/src/finding.bend as F
import bolt@1.27.0.0/src/rules/calls.bend as Calls
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy
import bolt@1.27.0.0/src/rules/table.bend as Table
67def check.go(
68 ds: List<&2, Calls.Def>,
69 +mods: List<&2, String>,
70 +path: String,
71 acc: List<&2, List<&2, F.Finding>>
72) -> List<&2, F.Finding>:
73 match ds:
74 case Nil{}:
75 List.concat(&2, F.Finding, List.reverse(&2, List<&2, F.Finding>, acc))
76 case Con{Calls.Def{+name, +sig, +body}, rest}:
77 check.go(rest, mods, path,
78 Lazy.stop(List<&2, F.Finding>,
79 Bool.not(Bool.and(Calls.calls(body, name), Bool.not(Calls.exempt(path, sig)))), [],
80 _u => walk(body, path, Table.scope(body, mods), name)) <> acc)