xlog/lib/util.ml

10 lines
317 B
OCaml
Raw Normal View History

2024-04-23 02:36:13 +00:00
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