def seek.head

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

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

1017# the binder at the head of a cursor, when it sits at the position
1018def seek.head(cur: List<&2, Bind>, +line: U32, +col: U32) -> Maybe<&2, Bind>:
1019  match cur:
1020    case Nil{}:
1021      None{}
1022    case Con{Bind{name, +l, +c, kind, note}, rest}:
1023      Bool.pick(Maybe<&2, Bind>, Bool.and(U32.is_eq(l, line), U32.is_eq(c, col)), Some{Bind{name, l, c, kind, note}},
1024        None{})

Uses (7)

Used by (1)