def settings.go
bolt@1.26.0.0 · src/config.bend:107
import bolt@1.26.0.0/src/config.bend as Config
import Base
import bolt@1.26.0.0/src/syntax/tree.bend as Tree
import bolt@1.26.0.0/src/syntax/bind.bend as Bind
107
108def settings.go(root: Tree.Node) -> List<&2, Setting>:
109 match root:
110 case Tree.NCons{Tree.Stmt{Tree.SDef{}, +kids, body}, rest}:
111 +ln = Tree.line(kids)
112 List.append(&2, Setting, setting(Bind.declared(kids), first_str(Tree.leaves(body)), ln), settings.go(rest))
113 case Tree.NCons{_h, rest}:
114 settings.go(rest)
115 case _other:
116 Nil{}