Digest.spans: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/digest.bend as Digest Lines 89-100 of bolt@1.27.0.0/src/rules/digest.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/rules/digest.bend&start_line=89&end_line=100 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/rules/laws/closed.bend as Closed # the spans of every quantified law of a tree, in order. A closed law spans # nothing (it covers one input, not the def) def spans(root: Tree.Node) -> List<&2, Span>: match root: case Tree.NCons{Tree.Stmt{Tree.SLaw{}, kids, +body}, rest}: +more = spans(rest) Bool.pick(List<&2, Span>, Closed.binds(body), Span{Tree.line(kids), Tree.line.of(List.head(&2, Lex.Tok, Tree.leaves.go(body, [])))} <> more, more) case Tree.NCons{h, rest}: spans(rest) case other: Nil{} Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.head https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/digest.bend&name=Span https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/laws/closed.bend&name=binds https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/lex.bend&name=Tok https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/tree.bend&name=Node https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/tree.bend&name=StmtKind https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/tree.bend&name=leaves.go https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/tree.bend&name=line https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/tree.bend&name=line.of