def plan.peek

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

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

410# the chain's first token; a blank one when it does not start with a leaf
411def plan.peek(rest: Tree.Node) -> Lex.Tok:
412  match rest:
413    case Tree.NCons{Tree.Leaf{tok}, _r}:
414      tok
415    case _other:
416      Lex.Tok{Lex.TSpace{}, "", 0, 0}

Uses (3)

Used by (1)