def roots.of

bolt@1.27.0.0 · src/lint/plan.bend:229

import bolt@1.27.0.0/src/lint/plan.bend as Plan
import Base
import bolt@1.27.0.0/src/lint/world.bend as W

229# the directories the walk read that hold a main.bend, `.` left out
230def roots.of(ds: List<&2, String>, +world: W.World) -> List<&2, String>:
231  match ds:
232    case Nil{}:
233      Nil{}
234    case Con{+d, rest}:
235      +more = roots.of(rest, world)
236      +root = Bool.and(Bool.not(String.eq(d, ".")), seen.has(W.listing(world, d), "main.bend"))
237      Bool.pick(List<&2, String>, root, d <> more, more)

Uses (9)

Used by (1)