def before
import bolt@1.27.0.0/src/rules/digest.bend as Digestimport Base
import bolt@1.27.0.0/src/syntax/bind.bend as Bind
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy
159# the uses, in order, before the first one at or past the line
160def before(us: List<&2, Bind.Use>, +at: U32) -> List<&2, Bind.Use>:
161 match us:
162 case Nil{}:
163 Nil{}
164 case Con{Bind.Use{nm, +l, c, tt}, rest}:
165 Lazy.stop(List<&2, Bind.Use>, U32.is_le(at, l), [], _u => Bind.Use{nm, l, c, tt} <> before(rest, at))