diff --git a/jscomp/others/belt_HashMap.ml b/jscomp/others/belt_HashMap.ml index 789ac4e1cf..270b827344 100644 --- a/jscomp/others/belt_HashMap.ml +++ b/jscomp/others/belt_HashMap.ml @@ -41,7 +41,7 @@ let rec copyBucketReHash ~hash ~h_buckets ~ndata_tail old_bucket = match C.toOpt old_bucket with | None -> () | Some cell -> - let nidx = (hash cell.N.key [@bs]) land (A.length h_buckets - 1) in + let nidx = (hash cell.N.key [@u]) land (A.length h_buckets - 1) in let v = C.return cell in (match C.toOpt (A.getUnsafe ndata_tail nidx) with | None -> A.setUnsafe h_buckets nidx v @@ -70,7 +70,7 @@ let resize ~hash h = done) let rec replaceInBucket ~eq key info cell = - if eq cell.N.key key [@bs] then ( + if eq cell.N.key key [@u] then ( cell.N.value <- info; false) else @@ -81,7 +81,7 @@ let rec replaceInBucket ~eq key info cell = let set0 h key value ~eq ~hash = let h_buckets = h.C.buckets in let buckets_len = A.length h_buckets in - let i = (hash key [@bs]) land (buckets_len - 1) in + let i = (hash key [@u]) land (buckets_len - 1) in let l = A.getUnsafe h_buckets i in (match C.toOpt l with | None -> @@ -106,7 +106,7 @@ let rec removeInBucket h h_buckets i key prec bucket ~eq = | None -> () | Some cell -> let cell_next = cell.N.next in - if eq cell.N.key key [@bs] then ( + if eq cell.N.key key [@u] then ( prec.N.next <- cell_next; h.C.size <- h.C.size - 1) else removeInBucket ~eq h h_buckets i key cell cell_next @@ -114,14 +114,14 @@ let rec removeInBucket h h_buckets i key prec bucket ~eq = let remove h key = let h_buckets = h.C.buckets in let i = - ((Belt_Id.getHashInternal h.C.hash) key [@bs]) land (A.length h_buckets - 1) + ((Belt_Id.getHashInternal h.C.hash) key [@u]) land (A.length h_buckets - 1) in let bucket = A.getUnsafe h_buckets i in match C.toOpt bucket with | None -> () | Some cell -> let eq = Belt_Id.getEqInternal h.C.eq in - if eq cell.N.key key [@bs] then ( + if eq cell.N.key key [@u] then ( A.setUnsafe h_buckets i cell.N.next; h.C.size <- h.C.size - 1) else removeInBucket ~eq h h_buckets i key cell cell.N.next @@ -130,33 +130,33 @@ let rec getAux ~eq key buckets = match C.toOpt buckets with | None -> None | Some cell -> - if eq key cell.N.key [@bs] then Some cell.N.value + if eq key cell.N.key [@u] then Some cell.N.value else getAux ~eq key cell.N.next let get h key = let h_buckets = h.C.buckets in let nid = - ((Belt_Id.getHashInternal h.C.hash) key [@bs]) land (A.length h_buckets - 1) + ((Belt_Id.getHashInternal h.C.hash) key [@u]) land (A.length h_buckets - 1) in match C.toOpt (A.getUnsafe h_buckets nid) with | None -> None | Some (cell1 : _ N.bucket) -> ( let eq = Belt_Id.getEqInternal h.C.eq in - if eq key cell1.key [@bs] then Some cell1.value + if eq key cell1.key [@u] then Some cell1.value else match C.toOpt cell1.N.next with | None -> None | Some cell2 -> ( - if eq key cell2.key [@bs] then Some cell2.value + if eq key cell2.key [@u] then Some cell2.value else match C.toOpt cell2.next with | None -> None | Some cell3 -> - if eq key cell3.key [@bs] then Some cell3.value + if eq key cell3.key [@u] then Some cell3.value else getAux ~eq key cell3.next)) let rec memInBucket key cell ~eq = - (eq cell.N.key key [@bs]) + (eq cell.N.key key [@u]) || match C.toOpt cell.N.next with | None -> false @@ -165,7 +165,7 @@ let rec memInBucket key cell ~eq = let has h key = let h_buckets = h.C.buckets in let nid = - ((Belt_Id.getHashInternal h.C.hash) key [@bs]) land (A.length h_buckets - 1) + ((Belt_Id.getHashInternal h.C.hash) key [@u]) land (A.length h_buckets - 1) in let bucket = A.getUnsafe h_buckets nid in match C.toOpt bucket with diff --git a/jscomp/others/belt_HashSet.ml b/jscomp/others/belt_HashSet.ml index 5b5cf982ce..2192b7a2a1 100644 --- a/jscomp/others/belt_HashSet.ml +++ b/jscomp/others/belt_HashSet.ml @@ -1,5 +1,5 @@ (* Copyright (C) 2017 Hongbo Zhang, Authors of ReScript - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -17,7 +17,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) @@ -38,7 +38,7 @@ let rec copyBucket ~hash ~h_buckets ~ndata_tail old_bucket = | None -> () | Some cell -> let nidx = - ((Belt_Id.getHashInternal hash) cell.N.key [@bs]) + ((Belt_Id.getHashInternal hash) cell.N.key [@u]) land (A.length h_buckets - 1) in let v = C.return cell in @@ -70,7 +70,7 @@ let tryDoubleResize ~hash h = let rec removeBucket ~eq h h_buckets i key prec cell = let cell_next = cell.N.next in - if (Belt_Id.getEqInternal eq) cell.N.key key [@bs] then ( + if (Belt_Id.getEqInternal eq) cell.N.key key [@u] then ( prec.N.next <- cell_next; h.C.size <- h.C.size - 1) else @@ -82,14 +82,14 @@ let remove h key = let eq = h.C.eq in let h_buckets = h.C.buckets in let i = - ((Belt_Id.getHashInternal h.C.hash) key [@bs]) land (A.length h_buckets - 1) + ((Belt_Id.getHashInternal h.C.hash) key [@u]) land (A.length h_buckets - 1) in let l = A.getUnsafe h_buckets i in match C.toOpt l with | None -> () | Some cell -> ( let next_cell = cell.N.next in - if (Belt_Id.getEqInternal eq) cell.N.key key [@bs] then ( + if (Belt_Id.getEqInternal eq) cell.N.key key [@u] then ( h.C.size <- h.C.size - 1; A.setUnsafe h_buckets i next_cell) else @@ -98,7 +98,7 @@ let remove h key = | Some next_cell -> removeBucket ~eq h h_buckets i key cell next_cell) let rec addBucket h key cell ~eq = - if not ((Belt_Id.getEqInternal eq) cell.N.key key [@bs]) then + if not ((Belt_Id.getEqInternal eq) cell.N.key key [@u]) then let n = cell.N.next in match C.toOpt n with | None -> @@ -109,7 +109,7 @@ let rec addBucket h key cell ~eq = let add0 h key ~hash ~eq = let h_buckets = h.C.buckets in let buckets_len = A.length h_buckets in - let i = ((Belt_Id.getHashInternal hash) key [@bs]) land (buckets_len - 1) in + let i = ((Belt_Id.getHashInternal hash) key [@u]) land (buckets_len - 1) in let l = A.getUnsafe h_buckets i in (match C.toOpt l with | None -> @@ -121,7 +121,7 @@ let add0 h key ~hash ~eq = let add h key = add0 ~hash:h.C.hash ~eq:h.C.eq h key let rec memInBucket ~eq key cell = - ((Belt_Id.getEqInternal eq) cell.N.key key [@bs]) + ((Belt_Id.getEqInternal eq) cell.N.key key [@u]) || match C.toOpt cell.N.next with | None -> false @@ -130,7 +130,7 @@ let rec memInBucket ~eq key cell = let has h key = let eq, h_buckets = (h.C.eq, h.C.buckets) in let nid = - ((Belt_Id.getHashInternal h.C.hash) key [@bs]) land (A.length h_buckets - 1) + ((Belt_Id.getHashInternal h.C.hash) key [@u]) land (A.length h_buckets - 1) in let bucket = A.getUnsafe h_buckets nid in match C.toOpt bucket with diff --git a/jscomp/others/belt_HashSet.mli b/jscomp/others/belt_HashSet.mli index c043144ffc..68a8ef8dd9 100644 --- a/jscomp/others/belt_HashSet.mli +++ b/jscomp/others/belt_HashSet.mli @@ -33,14 +33,14 @@ type t = int module I0 = (val Belt.Id.hashableU - ~hash:(fun[\@bs] (a : t) -> a & 0xff_ff) - ~eq:(fun[\@bs] a b -> a = b) + ~hash:(fun[\@u] (a : t) -> a & 0xff_ff) + ~eq:(fun[\@u] a b -> a = b) ) let s0 = make ~id:(module I0) ~hintSize:40 module I1 = (val Belt.Id.hashableU - ~hash:(fun[\@bs] (a : t) -> a & 0xff) - ~eq:(fun[\@bs] a b -> a = b) + ~hash:(fun[\@u] (a : t) -> a & 0xff) + ~eq:(fun[\@u] a b -> a = b) ) let s1 = make ~id:(module I1) ~hintSize:40 ]} diff --git a/jscomp/others/node_process.ml b/jscomp/others/node_process.ml index 6923455e9d..4ae9e654a9 100644 --- a/jscomp/others/node_process.ml +++ b/jscomp/others/node_process.ml @@ -41,7 +41,7 @@ external exit : int -> 'a = "exit" [@@mel.module "process"] external cwd : unit -> string = "cwd" [@@mel.module "process"] external uptime : t -> unit -> float = "uptime" - [@@mel.send] +[@@mel.send] (** The process.uptime() method returns the number of seconds the current Node.js process has been running.) *) @@ -52,4 +52,4 @@ external uptime : t -> unit -> float = "uptime" *) let putEnvVar key (var : string) = Js.Dict.set process##env key var -let deleteEnvVar s = (Js.Dict.unsafeDeleteKey process##env s [@bs]) +let deleteEnvVar s = (Js.Dict.unsafeDeleteKey process##env s [@u])