def bind_at.go

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

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

906# the binder whose name covers a position; hit: the one before binds did,
907# so the search stops there
908def bind_at.go(binds: List<&2, Bind>, +line: U32, +col: U32, hit: Maybe<&2, Site>) -> Maybe<&2, Site>:
909  match binds:
910    case Nil{}:
911      hit
912    case Con{Bind{+name, +l, +c, kind, note}, rest}:
913      match hit:
914        case Some{x}:
915          Some{x}
916        case None{}:
917          bind_at.go(rest, line, col,
918            Bool.pick(Maybe<&2, Site>, covers(l, c, name, line, col), Some{SBind{Bind{name, l, c, kind, note}}},
919              None{}))

Uses (7)

Used by (1)