def from_line

bolt@1.27.0.0 · src/rules/digest.bend:276

import bolt@1.27.0.0/src/rules/digest.bend as Digest
import Base
import bolt@1.27.0.0/src/syntax/outline.bend as Outline

276# the items from the first on or after a line; the items are in line order,
277# and so are a tree's laws, so an item this drops lies above every later law
278# too. stop is from_line.stop of items, carried so the step stays a loop
279def from_line(items: List<&2, Outline.Item>, +at: U32, +stop: Bool) -> List<&2, Outline.Item>:
280  match items:
281    case Nil{}:
282      Nil{}
283    case Con{h, +rest}:
284      match stop:
285        case True{}:
286          h <> rest
287        case False{}:
288          from_line(rest, at, from_line.stop(rest, at))

Uses (5)

Used by (1)