This repository was archived by the owner on Apr 24, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +3
-18
lines changed
Expand file tree Collapse file tree 3 files changed +3
-18
lines changed Original file line number Diff line number Diff line change @@ -46,11 +46,11 @@ let isSourceFile name =
4646 || Filename. check_suffix name " .mli"
4747
4848let compiledNameSpace name =
49- Str. split ( Str. regexp_string " - " ) name
49+ String. split_on_char '-' name
5050 |> List. map String. capitalize_ascii
5151 |> String. concat " "
5252 (* Remove underscores??? Whyyy bucklescript, whyyyy *)
53- |> Str. split ( Str. regexp_string " _ " )
53+ |> String. split_on_char '_'
5454 |> String. concat " "
5555
5656let compiledBaseName ~namespace name =
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ let newBsPackage rootPath =
7979 match item |> Json. string with
8080 | None -> opens
8181 | Some s -> (
82- let parts = Utils . split_on_char ' ' s in
82+ let parts = String . split_on_char ' ' s in
8383 match parts with
8484 | "-open" :: name :: _ -> name :: opens
8585 | _ -> opens))
Original file line number Diff line number Diff line change 1- (*
2- steal from OCaml stdlib
3- https://github.com/ocaml/ocaml/blob/7c9c210884e1b46f21af5bb4dfab995bb3336cf7/stdlib/string.ml#L205-L214
4- *)
5- let split_on_char sep s =
6- let open String in
7- let r = ref [] in
8- let j = ref (length s) in
9- for i = length s - 1 downto 0 do
10- if unsafe_get s i = sep then (
11- r := sub s (i + 1 ) (! j - i - 1 ) :: ! r;
12- j := i)
13- done ;
14- sub s 0 ! j :: ! r
15-
161let topLoc fname =
172 {
183 Location. loc_start =
You can’t perform that action at this time.
0 commit comments