BendLintRules.Spans.last: def of bend-lint-rules@0.2.0.0 Import: import bend-lint-rules@0.2.0.0/lib/text/main.bend as BendLintRules Lines 175-184 of bend-lint-rules@0.2.0.0/lib/text/main.bend: https://jend.leeeet.dev/read.txt?path=bend-lint-rules@0.2.0.0/lib/text/main.bend&start_line=175&end_line=184 import Base # The end of the last span of `t` (by start, then end) that starts before `e`, or `found`. `before` says whether the # root's does. Its end is the furthest of theirs, as ends rise with starts. def Spans.last(t: Spans, +e: U32, found: Maybe<&2, U32>, before: Bool) -> Maybe<&2, U32>: match t before: case SLeaf{} _: found case SNode{h, l, x, y, +r} True{}: Spans.last(r, e, Some{y}, Spans.starts_before(r, e)) case SNode{h, +l, x, y, r} False{}: Spans.last(l, e, found, Spans.starts_before(l, e)) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/lib/text/main.bend&name=Spans https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/lib/text/main.bend&name=Spans.starts_before