def of

bolt@1.27.0.0 · src/src.bend:16

import bolt@1.27.0.0/src/src.bend as Src
import Base
import bolt@1.27.0.0/src/syntax/lex.bend as Lex
import bolt@1.27.0.0/src/syntax/tree.bend as Tree
import bolt@1.27.0.0/src/syntax/bind.bend as Bind
import bolt@1.27.0.0/src/syntax/outline.bend as Outline

16# read a file's text once
17def of(+path: String, +text: String) -> Src:
18  +toks = Lex.tokens(text)
19  +tree = Tree.of_tokens(toks)
20  Src{path, text, toks, tree, Bind.of_tree(tree, String.lines(text)), Outline.of_tokens(text, toks)}

Uses (7)

Used by (2)