aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/ur/json.ur
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ur/json.ur')
-rw-r--r--lib/ur/json.ur4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ur/json.ur b/lib/ur/json.ur
index 1e3e3f39..817ec16e 100644
--- a/lib/ur/json.ur
+++ b/lib/ur/json.ur
@@ -52,6 +52,8 @@ fun escape s =
| #"\t" => "\\t"
| #"\"" => "\\\""
| #"\'" => "\\\'"
+ | #"\\" => "\\\\"
+ | #"/" => "\\/"
| x => String.str ch
) ^ esc (String.suffix s 1)
end
@@ -100,6 +102,8 @@ fun unescape s =
| #"t" => "\t"
| #"\"" => "\""
| #"\'" => "\'"
+ | #"\\" => "\\"
+ | #"/" => "/"
| x => error <xml>JSON unescape: Bad escape char: {[x]}</xml>)
^
unesc (i+2)