Core.Std.Char

Reviewed By: cristianoc

Differential Revision: D4232439

fbshipit-source-id: 686057b
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent c2abce7e3a
commit e5b41a67d0

@ -386,7 +386,7 @@ let call_should_be_skipped callee_summary =
(** In case of constant string dereference, return the result immediately *)
let check_constant_string_dereference lexp =
let string_lookup s n =
let c = try Char.code (String.get s (IntLit.to_int n)) with Invalid_argument _ -> 0 in
let c = try Char.to_int (String.get s (IntLit.to_int n)) with Invalid_argument _ -> 0 in
Exp.int (IntLit.of_int c) in
match lexp with
| Exp.BinOp(Binop.PlusPI, Exp.Const (Const.Cstr s), e)

@ -27,7 +27,7 @@ let escape_map map_fun s =
let escape_csv s =
let map = function
| '"' -> Some "\"\""
| c when Char.code c > 127 -> Some "?" (* non-ascii character: escape *)
| c when Char.to_int c > 127 -> Some "?" (* non-ascii character: escape *)
| _ -> None in
escape_map map s
@ -39,8 +39,8 @@ let escape_xml s =
| '<' -> Some "&lt;"
| '&' -> Some "&amp;"
| '%' -> Some "&#37;"
| c when Char.code c > 127 -> (* non-ascii character: escape *)
Some ("&#" ^ string_of_int (Char.code c) ^ ";")
| c when Char.to_int c > 127 -> (* non-ascii character: escape *)
Some ("&#" ^ string_of_int (Char.to_int c) ^ ";")
| _ -> None in
escape_map map s
@ -63,6 +63,6 @@ let escape_path s =
as Python may need to see them *)
let escape_filename s =
let map = function
| c when Char.code c > 127 -> Some "?" (* non-ascii character: escape *)
| c when Char.to_int c > 127 -> Some "?" (* non-ascii character: escape *)
| _ -> None in
escape_map map s

@ -15,6 +15,7 @@ module Array = Core.Std.Array
module Bool = Core.Std.Bool
module Bytes = Core.Std.Bytes
module Caml = Core.Std.Caml
module Char = Core.Std.Char
module Filename = Core.Std.Filename
module Fn = Core.Std.Fn
module In_channel = Core.Std.In_channel

@ -15,6 +15,7 @@ module Array = Core.Std.Array
module Bool = Core.Std.Bool
module Bytes = Core.Std.Bytes
module Caml = Core.Std.Caml
module Char = Core.Std.Char
module Filename = Core.Std.Filename
module Fn = Core.Std.Fn
module In_channel = Core.Std.In_channel

Loading…
Cancel
Save