def places.walk

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

import bend-lint-rules@0.2.0.0/lib/text/main.bend as BendLintRules
import Base
import bend-lint-api@0.2.0.0/shared/lists.bend as Lists
import bend-lint-api@0.2.0.0/shared/names.bend as Names

369# The requests of each file of `paths` placed in its text, onto `out`; a file `texts` lacks places them at its start.
370def places.walk(
371  paths: List<&2, String>,
372  +groups: Map<&2, List<&2, Placed>>,
373  +texts: Map<&2, String>,
374  out: Map<&2, Position>
375) -> Map<&2, Position>:
376  match paths:
377    case Nil{}:
378      out
379    case Con{+path, rest}:
380      places.walk(
381        rest,
382        groups,
383        texts,
384        places.keep(
385          Walk.locate(
386            Lists.sort(~Placed, ~Placed.is_le, Names.Group.get(Placed, groups, path)),
387            Pair.snd(Map<&2, String>, String, Map.get(String, "", texts, path))
388          ),
389          path,
390          out
391        )
392      )

Uses (12)

Used by (1)