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