def of.role

bolt@1.27.0.0 · src/rules/digest.bend:334

import bolt@1.27.0.0/src/rules/digest.bend as Digest
import Base
import bolt@1.27.0.0/src/src.bend as Src
import bolt@1.27.0.0/src/rules/imports.bend as Imports
import bolt@1.27.0.0/src/paths.bend as Paths
import bolt@1.27.0.0/src/role.bend as Role
import bolt@1.27.0.0/src/rules/calls.bend as Calls

334# one parsed file read down to its digest, told its role (src/role.bend): a
335# law file states the laws that cover defs, and a law or proof file is exempt
336def of.role(+rr: Role.Role, s2: Src.Src) -> Digest:
337  Src.Src{+path, text, toks, +tree, +bound, +items} = s2
338  +p = Imports.norm(path)
339  +as = aliases(items, p)
340  +laws = Role.is_laws(rr)
341  Digest{path, p, Imports.dir_of(path), laws, Role.is_law_file(rr), Bool.or(Role.is_law_file(rr), Paths.is_test(p)),
342    ranged(items, uses.of(bound), as, p, proofs(Calls.defs(tree))), stated(laws, tree, bound, as, p),
343    Imports.targets(items, p),
344    laws.in(laws, tree, items)}

Uses (17)

Used by (1)