def Node.bound

bend-lint-api@0.2.0.0 · linter/lint.bend:278

import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
import Base

278# The binders of the pattern variables in `nodes`, patterns, and under them, onto `out`.
279def Node.bound(nodes: List<&2, Node>, out: List<&2, U32>) -> List<&2, U32>:
280  match nodes:
281    case Nil{}:
282      out
283    case Con{Node{PatternVariable{b, q}, n, s, k, f}, rest}:
284      Node.bound(rest, b <> out)
285    case Con{Node{PatternConstructor{t}, n, s, kids, f}, rest}:
286      Node.bound(rest, Node.bound(kids, out))
287    case Con{node, rest}:
288      Node.bound(rest, out)

Uses (4)

Used by (1)