def use_at.go

bolt@1.27.0.0 · src/syntax/bind.bend:925

import bolt@1.27.0.0/src/syntax/bind.bend as Bind
import Base

925# the use whose name covers a position; hit: the one before uses did, so the
926# search stops there
927def use_at.go(uses: List<&2, Use>, +line: U32, +col: U32, hit: Maybe<&2, Site>) -> Maybe<&2, Site>:
928  match uses:
929    case Nil{}:
930      hit
931    case Con{Use{+name, +l, +c, tg}, rest}:
932      match hit:
933        case Some{x}:
934          Some{x}
935        case None{}:
936          use_at.go(rest, line, col,
937            Bool.pick(Maybe<&2, Site>, covers(l, c, name, line, col), Some{SUse{Use{name, l, c, tg}}}, None{}))

Uses (7)

Used by (1)