def skip

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

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

1421# The first offset at or after k whose byte may start a match, or len; r holds the probe of k.
1422def skip(fuel: Nat, r: Array<U32> & Bool, +len: U32, +k: U32, +m: Asc) -> Array<U32> & U32:
1423  match fuel:
1424    case 0n:
1425      (a, h) = r
1426      (a, k)
1427    case 1n+f:
1428      (a, hit) = r
1429      match hit:
1430        case True{}:
1431          (a, k)
1432        case False{}:
1433          skip(f, probe(a, len, (k + 1 : U32), m), len, (k + 1 : U32), m)

Uses (9)

Used by (1)