def starting.go

bolt@1.27.0.0 · src/syntax/outline.bend:572

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

572def starting.go(items: List<&2, Item>, +prefix: String, +qual: String, +seen: List<&2, String>) -> List<&2, Item>:
573  match items:
574    case Nil{}:
575      Nil{}
576    case Con{Item{+k, +nm, l, s, d, p}, t}:
577      +take = Bool.and(Bool.and(Bool.not(is_import(k)), String.starts_with(nm, prefix)), Bool.not(has(seen, nm)))
578      # one recursive call: Bool.pick evaluates both of its branches
579      +rest = starting.go(t, prefix, qual, Bool.pick(List<&2, String>, take, nm <> seen, seen))
580      Bool.pick(List<&2, Item>, take, Item{k, qual ++ nm, l, s, d, p} <> rest, rest)

Uses (10)

Used by (1)