1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-13 07:34:50 +00:00
freebsd-ports/lang/smlnj/files/do-patch-smlnj-lib_JSON_json-stream-printer.sml
Thomas Zander 93222f7d20 Update to upstream version 110.91
PR:		239858
Submitted by:	joemann@beefree.free.de (maintainer)
2019-09-21 11:42:25 +00:00

26 lines
911 B
Standard ML

--- smlnj-lib/JSON/json-stream-printer.sml.orig 2017-07-14 20:32:40 UTC
+++ smlnj-lib/JSON/json-stream-printer.sml
@@ -103,14 +103,14 @@ structure JSONStreamPrinter : sig
fun tr (i, chrs) = (case getWChar i
of SOME(wchr, i) => if (wchr <= 0w126)
then (case UTF8.toAscii wchr
- of #"\"" => "\\\""
- | #"\\" => "\\\\"
- | #"/" => "\\/"
- | #"\b" => "\\b"
- | #"\f" => "\\f"
- | #"\n" => "\\n"
- | #"\r" => "\\r"
- | #"\t" => "\\t"
+ of #"\"" => tr(i, "\\\"" :: chrs)
+ | #"\\" => tr(i, "\\\\" :: chrs)
+ | #"/" => tr(i, "\\/" :: chrs)
+ | #"\b" => tr(i, "\\b" :: chrs)
+ | #"\f" => tr(i, "\\f" :: chrs)
+ | #"\n" => tr(i, "\\n" :: chrs)
+ | #"\r" => tr(i, "\\r" :: chrs)
+ | #"\t" => tr(i, "\\t" :: chrs)
| c => if (wchr < 0w32)
then tr(i, F.format "\\u%04x" [F.WORD wchr] :: chrs)
else tr(i, str c :: chrs)