def fresh

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

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

375# a significant token that starts a line: at column 0 it closes every open
376# group (unless it is a bracket closing one of them); outside a group it opens
377# a statement
378def fresh(+stack: List<&2, Frame>, +tok: Lex.Tok) -> List<&2, Frame>:
379  Lex.Tok{k, t, l, +c} = tok
380  +cuts = Bool.and(Bool.and(in_group(stack), U32.is_eq(c, 0)), Nat.is_eq(depth_to(stack, t), 0n))
381  open_stmt(Lazy.stop(List<&2, Frame>, Bool.not(cuts), stack, _u => close_all(stack)), c)

Uses (12)

Used by (1)