src/src.bend
bolt@1.27.0.0 · 20 lines · 2 definitions
1
2
3
4
5import Base
6import bolt@1.27.0.0/src/syntax/lex.bend as Lex
7import bolt@1.27.0.0/src/syntax/tree.bend as Tree
8import bolt@1.27.0.0/src/syntax/bind.bend as Bind
9import bolt@1.27.0.0/src/syntax/outline.bend as Outline
10
11
12type Src is Data:
13 Src{path: String, text: String, toks: List<&2, Lex.Tok>, tree: Tree.Node, bound: Bind.Bound,
14 items: List<&2, Outline.Item>}
15
16
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)}