def parameter.go

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

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

441def parameter.go(
442  nodes: List<&2, Node>,
443  found: Maybe<&2, Nat>,
444  +binder: U32,
445  +at: Nat
446) -> Maybe<&2, Nat>:
447  match nodes found:
448    case _ Some{n}:
449      Some{n}
450    case Nil{} None{}:
451      None{}
452    case Con{Node{Parameter{b, q}, n, s, k, f}, rest} None{}:
453      parameter.go(rest, Lists.when(Nat, U32.is_eq(b, binder), at), binder, 1n+at)
454    case Con{node, rest} None{}:
455      parameter.go(rest, None{}, binder, at)

Uses (8)

Used by (1)