def fact.text

bolt@1.27.0.0 · src/role.bend:79

import bolt@1.27.0.0/src/role.bend as Role
import Base
import bolt@1.27.0.0/src/paths.bend as Paths
import bolt@1.27.0.0/src/rules/imports.bend as Imports
import bolt@1.27.0.0/src/syntax/lex.bend as Lex
import bolt@1.27.0.0/src/syntax/outline.bend as Outline

79# a file's fact read from its text alone: lexed and outlined for its imports,
80# never parsed, so a file read only for its place in the graph costs little
81def fact.text(+path: String, +text: String) -> Fact:
82  +nn = Imports.norm(path)
83  Fact{nn, Imports.targets(Outline.of_tokens(text, Lex.tokens(text)), nn), of_path(path),
84    String.eq(Paths.base(path), "main.bend")}

Uses (9)

Used by (1)