Skip to content

Commit

Permalink
Merge pull request #3423 from FStarLang/gebner_ocaml5
Browse files Browse the repository at this point in the history
Move away from deprecated batteries functions.
  • Loading branch information
tahina-pro authored Nov 21, 2024
2 parents 0d1bb7c + c768b77 commit 51da68d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ocaml/fstar-lib/FStarC_Compiler_Bytes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let f_encode f (b:bytes) = String.concat "" (Array.to_list (Array.map f b))
let length (b:bytes) = BatArray.length b
let get (b:bytes) n = Z.of_int (BatArray.get b (Z.to_int n))
let make (f : _ -> Z.t) n = BatArray.init (Z.to_int n) (fun i -> Z.to_int (f (Z.of_int i)))
let zero_create n : bytes = BatArray.create n 0
let zero_create n : bytes = BatArray.make n 0

let sub ( b:bytes) s l = BatArray.sub b s l
let set = BatArray.set
Expand Down
4 changes: 2 additions & 2 deletions ocaml/fstar-lib/FStarC_Compiler_String.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ let get s i = BatUChar.code (BatUTF8.get s (Z.to_int i))
let collect f s =
let r = ref "" in
BatUTF8.iter (fun c -> r := !r ^ f (BatUChar.code c)) s; !r
let lowercase = BatString.lowercase
let uppercase = BatString.uppercase
let lowercase = BatString.lowercase_ascii
let uppercase = BatString.uppercase_ascii
let escaped = BatString.escaped
let index = get
exception Found of int
Expand Down
4 changes: 2 additions & 2 deletions ocaml/fstar-lib/FStar_String.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ let get s i = BatUChar.code (BatUTF8.get s (Z.to_int i))
let collect f s =
let r = ref "" in
BatUTF8.iter (fun c -> r := !r ^ f (BatUChar.code c)) s; !r
let lowercase = BatString.lowercase
let uppercase = BatString.uppercase
let lowercase = BatString.lowercase_ascii
let uppercase = BatString.uppercase_ascii
let escaped = BatString.escaped
let index = get
exception Found of int
Expand Down

0 comments on commit 51da68d

Please sign in to comment.