diff --git a/src/FindFiles.ml b/src/FindFiles.ml index abf949cc..ce0021db 100644 --- a/src/FindFiles.ml +++ b/src/FindFiles.ml @@ -46,11 +46,11 @@ let isSourceFile name = || Filename.check_suffix name ".mli" let compiledNameSpace name = - Str.split (Str.regexp_string "-") name + String.split_on_char '-' name |> List.map String.capitalize_ascii |> String.concat "" (* Remove underscores??? Whyyy bucklescript, whyyyy *) - |> Str.split (Str.regexp_string "_") + |> String.split_on_char '_' |> String.concat "" let compiledBaseName ~namespace name = diff --git a/src/Packages.ml b/src/Packages.ml index b7754704..d772400f 100644 --- a/src/Packages.ml +++ b/src/Packages.ml @@ -79,7 +79,7 @@ let newBsPackage rootPath = match item |> Json.string with | None -> opens | Some s -> ( - let parts = Utils.split_on_char ' ' s in + let parts = String.split_on_char ' ' s in match parts with | "-open" :: name :: _ -> name :: opens | _ -> opens)) diff --git a/src/Utils.ml b/src/Utils.ml index 819073ce..444b4f5c 100644 --- a/src/Utils.ml +++ b/src/Utils.ml @@ -1,18 +1,3 @@ -(* - steal from OCaml stdlib - https://github.com/ocaml/ocaml/blob/7c9c210884e1b46f21af5bb4dfab995bb3336cf7/stdlib/string.ml#L205-L214 -*) -let split_on_char sep s = - let open String in - let r = ref [] in - let j = ref (length s) in - for i = length s - 1 downto 0 do - if unsafe_get s i = sep then ( - r := sub s (i + 1) (!j - i - 1) :: !r; - j := i) - done; - sub s 0 !j :: !r - let topLoc fname = { Location.loc_start =