master
Nicolás Ojeda Bär 2018-02-27 18:47:32 +01:00
parent 5c7b441a20
commit e92ed4e543
1 changed files with 2 additions and 2 deletions

View File

@ -102,12 +102,12 @@ let trim s =
let rec needs_escape s n i =
if i >= n then false else
match String.unsafe_get s i with
match unsafe_get s i with
| '\"' | '\\' | '\000'..'\031' | '\127'.. '\255' -> true
| _ -> needs_escape s n (i+1)
let escaped s =
if needs_escape s (String.length s) 0 then
if needs_escape s (length s) 0 then
bts (B.escaped (bos s))
else
s