def marks.of

bolt@1.27.0.0 · src/role.bend:153

import bolt@1.27.0.0/src/role.bend as Role
import Base
import bolt@1.27.0.0/src/rules/imports.bend as Imports

153# the marks of the files the laws reach and the code does not, in the run's
154# order: a law file when a LAWS.bend reaches it
155def marks.of(
156  fs: List<&2, Fact>,
157  +laws: List<&2, String>,
158  +lawful: List<&2, String>,
159  +code: List<&2, String>
160) -> List<&2, Mark>:
161  match fs:
162    case Nil{}:
163      Nil{}
164    case Con{Fact{+norm, _deps, +named, _entry}, rest}:
165      +more = marks.of(rest, laws, lawful, code)
166      Bool.pick(List<&2, Mark>, Bool.and(Imports.has(laws, norm), Bool.not(Imports.has(code, norm))),
167        Mark{norm, role.of(named, reached(Imports.has(lawful, norm)))} <> more, more)

Uses (10)

Used by (1)