Z Escape Sequence

1 · Christopher Chedeau · Jan. 2, 2018, 3:25 p.m.
Andres Suarez pointed me to some interesting code in the Hack codebase: let slash_escaped_string_of_path path = let buf = Buffer.create (String.length path) in String.iter (fun ch -> match ch with | '\\' -> Buffer.add_string buf "zB" | ':' -> Buffer.add_string buf "zC" | '/' -> Buffer.add_string buf "zS" | '\x00' -> Buffer.add_string buf "z0" | […]...