def Spans.add

bend-lint-rules@0.2.0.0 · lib/text/main.bend:146

import bend-lint-rules@0.2.0.0/lib/text/main.bend as BendLintRules
import Base

146# `t` with the span from `b` to `e`; `side` is how it compares with the root's.
147def Spans.add(t: Spans, +b: U32, +e: U32, side: Cmp) -> Spans:
148  match t side:
149    case SLeaf{} _:
150      SNode{1, SLeaf{}, b, e, SLeaf{}}
151    case SNode{h, +l, x, y, r} LT{}:
152      Spans.balance(Spans.add(l, b, e, Spans.cmp(l, b, e)), x, y, r)
153    case SNode{h, l, x, y, +r} _:
154      Spans.balance(l, x, y, Spans.add(r, b, e, Spans.cmp(r, b, e)))

Uses (5)

Used by (0)

No other definition uses this definition.