def render_all

bolt@1.27.0.0 · src/syntax/bind.bend:312

import bolt@1.27.0.0/src/syntax/bind.bend as Bind
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

312# the text of a whole chain
313def render_all(nn: Tree.Node) -> String:
314  match nn:
315    case Tree.NCons{Tree.Leaf{Lex.Tok{k, t, l, c}}, rest}:
316      spaced(t) ++ render_all(rest)
317    case Tree.NCons{Tree.Group{Lex.Tok{k, t, l, c}, kids, close}, rest}:
318      t ++ render_all(kids) ++ render_close(close) ++ render_all(rest)
319    case other:
320      ""

Uses (6)

Used by (1)