bolt/src.bend checks
raw source on the hub · import 0x729eecea86ea5a2cdba3a2856a313bca/bolt/src.bend as Src
bolt/src: one file, read once and parsed once. A rule is handed this, not
the text: a tree parse of a 156 KB file costs 1.5 s here (the lexer alone
54 ms, and Bind.bound parses again), so twenty rules that each parsed
the text made the linter twenty times slower than it needs to be.
5 imports
import Base import ../syntax/lex.bend as Lex import ../syntax/tree.bend as Tree import ../syntax/bind.bend as Bind import ../syntax/outline.bend as Outline
Types
type Src source · line 12 · raw
Data
the path, the text, and the three readings of it every rule shares
Src@path:String -> @text:String -> @toks:List<&2, 0x729eecea86ea5a2cdba3a2856a313bca/syntax/lex.Tok> -> @tree:0x729eecea86ea5a2cdba3a2856a313bca/syntax/tree.Node -> @bound:0x729eecea86ea5a2cdba3a2856a313bca/syntax/bind.Bound -> @items:List<&2, 0x729eecea86ea5a2cdba3a2856a313bca/syntax/outline.Item> -> Src
Definitions
def of source · line 17 · raw
@+path:String -> @+text:String -> Src
read a file's text once