def push

bolt@1.27.0.0 · src/syntax/tree.bend:383

import bolt@1.27.0.0/src/syntax/tree.bend as Tree
import Base
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy
import bolt@1.27.0.0/src/syntax/lex.bend as Lex

383# an open bracket or a leaf into the innermost frame
384def push(+stack: List<&2, Frame>, +tok: Lex.Tok, glued: Bool) -> List<&2, Frame>:
385  Lex.Tok{+k, +t, l, c} = tok
386  Lazy.stop(List<&2, Frame>, Bool.not(closes_with(k, t)),
387    Bool.pick(List<&2, Frame>, Bool.or(Lex.is_open(k), opens_angle(k, t, glued)), FGroup{tok, NNil{}} <> stack,
388      put(stack, Leaf{tok})),
389    _u => close_any(stack, tok))

Uses (14)

Used by (1)