Print the JSON encoding of a string, handling all escaping correctly and including the surrounding quotes.
(jp-str x &key (ps 'ps)) → ps
We go to some effort to make this fast.
Function:
(defun jp-str-fn (x ps) (declare (xargs :stobjs (ps))) (declare (type string x)) (let ((__function__ 'jp-str)) (declare (ignorable __function__)) (b* ((rchars (vl-ps->rchars)) (col (vl-ps->col)) (xl (length x)) (rchars (cons #\" (bridge::json-encode-str-aux x 0 xl (cons #\" rchars)))) (col (+ 2 (jp-col-after-printing-string-aux col x 0 xl)))) (vl-ps-seq (vl-ps-update-rchars rchars) (vl-ps-update-col col)))))