def copy.rev

emerging-ezjson@1.3.0.0 · src/pull.bend:126

import emerging-ezjson@1.3.0.0/src/pull.bend as Pull
import Base

126# the first `nn` chars of `src`, reversed, for the escape copier
127def copy.rev(src: String, +nn: U32, zero: Bool, acc: List<&2, Char>) -> List<&2, Char>:
128  match src zero:
129    case s True{}:
130      acc
131    case SNil{} False{}:
132      acc
133    case SCon{h, t} False{}:
134      copy.rev(t, U32.sub(nn, 1), U32.is_zero(U32.sub(nn, 1)), h <> acc)

Uses (7)

Used by (1)