def check.go

bolt@1.27.0.0 · src/rules/pedantic/fuel.bend:167

import bolt@1.27.0.0/src/rules/pedantic/fuel.bend as Fuel
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
import bolt@1.27.0.0/src/syntax/bind.bend as Bind

167# each top-level statement, walked as its own def
168def check.go(root: Tree.Node, +fs: List<&2, Fuel>, +path: String) -> List<&2, F.Finding>:
169  match root:
170    case Tree.NCons{Tree.Stmt{kind, +kids, body}, rest}:
171      +self = own(Bind.declared(kids))
172      +head = calls(kids, fs, self, path)
173      +inner = calls(body, fs, self, path)
174      List.concat(&2, F.Finding, [head, inner, check.go(rest, fs, path)])
175    case Tree.NCons{h, rest}:
176      check.go(rest, fs, path)
177    case other:
178      Nil{}

Uses (9)

Used by (1)