def eps.go

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

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

818# fuel: each pc expands once and pushes at most two pcs.
819def eps.go(fuel: Nat, +prog: List<&2, Inst>, +at0: Bool, +at1: Bool, w: Ew) -> Ew:
820  match fuel:
821    case 0n:
822      w
823    case 1n+f:
824      match w:
825        case Ew{Nil{}, seen, mask, hit}:
826          Ew{Nil{}, seen, mask, hit}
827        case Ew{Con{+pc, t}, +seen, mask, hit}:
828          eps.go(f, prog, at0, at1, eps.seen(List.contains(~U32, ~U32.is_eq, seen, pc), prog, pc, at0, at1, Ew{t, seen, mask, hit}))

Uses (9)

Used by (1)