10 lines
317 B
OCaml
10 lines
317 B
OCaml
|
let dune_exe_rx = Str.regexp "^Dune__exe__"
|
||
|
let dune_underscore_rx = Str.regexp "__"
|
||
|
|
||
|
let parse_module_name (name : string) : string list =
|
||
|
match String.split_on_char '.' name with
|
||
|
| [] -> []
|
||
|
| fst::rst ->
|
||
|
let fst = Str.global_replace dune_exe_rx "[EXE]" fst in
|
||
|
(Str.split dune_underscore_rx fst) @ rst
|