def Draft.reasons

bend-lint-rules@0.2.0.0 · lib/linter/directives.bend:384

import bend-lint-rules@0.2.0.0/lib/linter/directives.bend as Directives
import Base

384# The reasons in `words`, split at each label, in order, after what is `read`.
385def Draft.reasons(
386  words: List<&2, String>,
387  read: List<&2, String> & List<&2, String>
388) -> List<&2, String>:
389  match words read:
390    case Nil{} Tuple{part, out}:
391      List.reverse(&2, String, Draft.part(part, out))
392    case Con{+w, rest} _:
393      Draft.reasons(rest, Draft.reasons.step(String.eq(w, Draft.label()), w, read))

Uses (9)

Used by (1)