def build

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

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

961def build(+node: Node, +n: U32) -> Regex:
962  +insts = {ISave{0} <> emit(node, 1, [ISave{1}, IMatch{}]) : List<&2, Inst>}
963  +fuel = Nat.add(Nat.mul(3n, List.length(&2, Inst, insts)), 2n)
964  +start = first(fuel, insts, Fs{[0], Nil{}, Nil{}})
965  Regex{trie.from(Inst, insts, 0, TTip{}), fuel, U32.to_nat((2 * n : U32)), start, bits(fuel, insts), asc(start), bits.plain(insts), required(node), rev.if(reverse.ok(node), node)}

Uses (21)

Used by (1)