def sq.unesc

cswap-bend-cli@0.1.0.0 · fmt/yscal.bend:45

import cswap-bend-cli@0.1.0.0/fmt/yscal.bend as Yscal
import Base

45# `''` inside single quotes is one quote. `prevq`: the last character was a
46# kept quote.
47def sq.unesc(s: String, +prevq: Bool) -> String:
48  match s:
49    case SNil{}:
50      ""
51    case SCon{Chr{+c}, t}:
52      sq.emit(prevq && U32.is_eq(c, 39), c, sq.unesc(t, Bool.not(prevq) && U32.is_eq(c, 39)))

Uses (7)

Used by (1)