def parse.tok

bend-kit-regex@0.8.0.0 · regex.bend:503

import bend-kit-regex@0.8.0.0/regex.bend as Regex
import Base

503def parse.tok(tok: Tok, +n: U32, rep: Bool, stack: List<&2, Frame>, alts: List<&2, Node>, cur: List<&2, Node>) -> Ps:
504  match tok:
505    case TAtom{a}:
506      Ps{n, False{}, stack, alts, a <> cur}
507    case TRep{+min, +max, g}:
508      parse.rep(Bool.and(Bool.not(rep), rep.ok(min, max)), cur, min, max, g, n, stack, alts)
509    case TOpen{cap}:
510      parse.open(cap, n, stack, alts, cur)
511    case TClose{}:
512      parse.close(stack, n, alts, cur)
513    case TBar{}:
514      Ps{n, False{}, stack, seq(cur) <> alts, Nil{}}

Uses (14)

Used by (1)