def rep.inf
import bend-kit-regex@0.8.0.0/regex.bend as Regeximport Base
452# x* is (x+)?, so an empty x cannot loop; x{n,} is n-1 copies then x+; x{n,m} is n copies then (x(x...)?)?, as RE2 builds them.
453def rep.inf(k: Nat, +g: Bool, +h: Node) -> Node:
454 match k:
455 case 0n:
456 NQuest{g, NPlus{g, h}}
457 case 1n+p:
458 rep.copies(p, h, NPlus{g, h})