2018-09-18 06:49:18 -07:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* OCaml *)
|
|
|
|
(* *)
|
|
|
|
(* Jeremie Dimino, Jane Street Europe *)
|
|
|
|
(* *)
|
|
|
|
(* Copyright 2018 Jane Street Group LLC *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. This file is distributed under the terms of *)
|
|
|
|
(* the GNU Lesser General Public License version 2.1, with the *)
|
|
|
|
(* special exception on linking described in the file LICENSE. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
Fixing typos in various files (#2246)
Note: Typos found with https://github.com/codespell-project/codespell
Here is the (semi-manual) command used to get (and correct) the typos:
$ codespell -i 3 -w --skip=".png,.gif,./ocaml/boot,./ocaml/.git,./ocaml/manual/styles,./ocaml/manual/manual/htmlman" -L minimise,instal,contructor,"o'caml",cristal,pres,clos,cmo,uint,iff,te,objext,nto,nd,mut,upto,larg,exten,leage,mthod,delte,tim,atleast,langage,hten,iwth,mke,contant,succint,methids,eles,valu,clas,modul,que,classe,missings,froms,defaut,correspondance,differents,configury,reachs,cas,approche,normale,dur,millon,amin,oje,transfert
2019-02-13 05:04:56 -08:00
|
|
|
(** Management of include directories.
|
2018-09-18 06:49:18 -07:00
|
|
|
|
|
|
|
This module offers a high level interface to locating files in the
|
|
|
|
load path, which is constructed from [-I] command line flags and a few
|
|
|
|
other parameters.
|
|
|
|
|
|
|
|
It makes the assumption that the contents of include directories
|
|
|
|
doesn't change during the execution of the compiler.
|
|
|
|
*)
|
|
|
|
|
|
|
|
val add_dir : string -> unit
|
|
|
|
(** Add a directory to the load path *)
|
|
|
|
|
|
|
|
val remove_dir : string -> unit
|
|
|
|
(** Remove a directory from the load path *)
|
|
|
|
|
|
|
|
val reset : unit -> unit
|
|
|
|
(** Remove all directories *)
|
|
|
|
|
|
|
|
val init : string list -> unit
|
|
|
|
(** [init l] is the same as [reset (); List.iter add_dir (List.rev l)] *)
|
|
|
|
|
|
|
|
val get_paths : unit -> string list
|
2020-06-02 15:10:38 -07:00
|
|
|
(** Return the list of directories passed to [add_dir] so far. *)
|
2018-09-18 06:49:18 -07:00
|
|
|
|
|
|
|
val find : string -> string
|
|
|
|
(** Locate a file in the load path. Raise [Not_found] if the file
|
|
|
|
cannot be found. This function is optimized for the case where the
|
|
|
|
filename is a basename, i.e. doesn't contain a directory
|
|
|
|
separator. *)
|
|
|
|
|
|
|
|
val find_uncap : string -> string
|
|
|
|
(** Same as [find], but search also for uncapitalized name, i.e. if
|
|
|
|
name is Foo.ml, allow /path/Foo.ml and /path/foo.ml to match. *)
|
|
|
|
|
|
|
|
module Dir : sig
|
|
|
|
type t
|
|
|
|
(** Represent one directory in the load path. *)
|
|
|
|
|
|
|
|
val create : string -> t
|
|
|
|
|
|
|
|
val path : t -> string
|
|
|
|
|
|
|
|
val files : t -> string list
|
|
|
|
(** All the files in that directory. This doesn't include files in
|
|
|
|
sub-directories of this directory. *)
|
|
|
|
end
|
|
|
|
|
|
|
|
val add : Dir.t -> unit
|
|
|
|
|
|
|
|
val get : unit -> Dir.t list
|
|
|
|
(** Same as [get_paths ()], except that it returns a [Dir.t list]. *)
|