def find_unq

bend-toon-codec@0.1.0.0 · src/split.bend:28

import bend-toon-codec@0.1.0.0/src/split.bend as Split
import Base

28# Index of the first `target` outside quotes, or `none()`.
29def find_unq(+s: String, +target: U32, +st: U32, +i: U32) -> U32:
30  match s:
31    case SNil{}:
32      none()
33    case SCon{Chr{c}, t}:
34      found(U32.is_eq(st, 0) && U32.is_eq(c, target), i, find_unq(t, target, qnext(st, c), (i + 1 : U32)))

Uses (9)

Used by (2)