2016-12-02 13:54:32 +00:00
|
|
|
open! Import
|
|
|
|
|
2018-03-03 18:03:37 +00:00
|
|
|
module Name : sig
|
|
|
|
type t = private string
|
|
|
|
|
|
|
|
val add_suffix : t -> string -> t
|
|
|
|
|
|
|
|
val t : t Sexp.To_sexp.t
|
|
|
|
val compare : t -> t -> Ordering.t
|
|
|
|
val of_string : string -> t
|
|
|
|
val to_string : t -> string
|
|
|
|
|
|
|
|
val pp : Format.formatter -> t -> unit
|
|
|
|
val pp_quote : Format.formatter -> t -> unit
|
|
|
|
|
2018-03-06 07:12:51 +00:00
|
|
|
module Set : Set.S with type elt = t
|
|
|
|
module Map : Map.S with type key = t
|
2018-03-03 11:53:04 +00:00
|
|
|
|
|
|
|
module Top_closure : Top_closure.S with type key := t
|
2018-03-03 18:03:37 +00:00
|
|
|
end
|
|
|
|
|
2017-04-20 15:41:16 +00:00
|
|
|
module Syntax : sig
|
|
|
|
type t = OCaml | Reason
|
|
|
|
end
|
|
|
|
|
|
|
|
module File : sig
|
|
|
|
type t =
|
|
|
|
{ name : string
|
|
|
|
; syntax: Syntax.t
|
|
|
|
}
|
|
|
|
|
|
|
|
val to_ocaml : t -> t
|
|
|
|
end
|
|
|
|
|
2016-12-02 13:54:32 +00:00
|
|
|
type t =
|
2018-03-03 18:03:37 +00:00
|
|
|
{ name : Name.t (** Name of the module. This is always the basename of the filename
|
2016-12-02 13:54:32 +00:00
|
|
|
without the extension. *)
|
2018-02-08 10:12:46 +00:00
|
|
|
; impl : File.t option
|
2017-04-20 15:41:16 +00:00
|
|
|
; intf : File.t option
|
|
|
|
|
|
|
|
; obj_name : string (** Object name. It is different from [name] for wrapped
|
|
|
|
modules. *)
|
2016-12-02 13:54:32 +00:00
|
|
|
}
|
|
|
|
|
2018-03-03 18:03:37 +00:00
|
|
|
val name : t -> Name.t
|
2018-02-06 11:48:04 +00:00
|
|
|
|
2016-12-02 13:54:32 +00:00
|
|
|
(** Real unit name once wrapped. This is always a valid module name. *)
|
2018-03-03 18:03:37 +00:00
|
|
|
val real_unit_name : t -> Name.t
|
2016-12-02 13:54:32 +00:00
|
|
|
|
2018-02-08 10:12:46 +00:00
|
|
|
val file : t -> dir: Path.t -> Ml_kind.t -> Path.t option
|
|
|
|
val cm_source : t -> dir: Path.t -> Cm_kind.t -> Path.t option
|
|
|
|
val cm_file : t -> obj_dir:Path.t -> Cm_kind.t -> Path.t option
|
2018-01-21 21:36:30 +00:00
|
|
|
val cmt_file : t -> obj_dir:Path.t -> Ml_kind.t -> Path.t option
|
2017-05-11 17:09:44 +00:00
|
|
|
|
2018-02-07 13:03:13 +00:00
|
|
|
val obj_file : t -> obj_dir:Path.t -> ext:string -> Path.t
|
|
|
|
|
2018-02-08 10:12:46 +00:00
|
|
|
(** Same as [cm_file] but doesn't raise if [cm_kind] is [Cmo] or [Cmx]
|
|
|
|
and the module has no implementation. *)
|
|
|
|
val cm_file_unsafe : t -> obj_dir:Path.t -> Cm_kind.t -> Path.t
|
|
|
|
|
2018-01-13 12:51:28 +00:00
|
|
|
val odoc_file : t -> doc_dir:Path.t -> Path.t
|
2017-05-11 17:09:44 +00:00
|
|
|
|
|
|
|
(** Either the .cmti, or .cmt if the module has no interface *)
|
2018-01-21 21:36:30 +00:00
|
|
|
val cmti_file : t -> obj_dir:Path.t -> Path.t
|
2017-12-11 10:47:45 +00:00
|
|
|
|
|
|
|
val iter : t -> f:(Ml_kind.t -> File.t -> unit) -> unit
|
2018-02-08 10:12:46 +00:00
|
|
|
|
|
|
|
val has_impl : t -> bool
|
|
|
|
|
|
|
|
(** Set the [obj_name] field of the module. [wrapper] might be a library name. *)
|
|
|
|
val set_obj_name : t -> wrapper:string option -> t
|