def esc.b.pair

bend-kit-json@0.7.0.0 · json.bend:322

import bend-kit-json@0.7.0.0/json.bend as Json
import Base

322# A high surrogate must pair in strict mode; RFC §8.2 mode replaces a lone one.
323def esc.b.pair(+strict: Bool, +len: U32, +i: U32, +hi: U32, acc: W, key: Bool, stack: List<&1, Open>, r: Array<U32> & Bool) -> Array<U32> & Sb:
324  (a, ok) = r
325  match ok:
326    case True{}:
327      esc.b.lo(strict, i, hi, acc, key, stack, hex4.b(a, len, (i + 8 : U32)))
328    case False{}:
329      (a, esc.b.lone(strict, i, acc, key, stack))

Uses (13)

Used by (1)