Skip to content

Commit

Permalink
Add named_root type
Browse files Browse the repository at this point in the history
  • Loading branch information
jonludlam committed Nov 13, 2024
1 parent 894fb5d commit d13d655
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
14 changes: 8 additions & 6 deletions src/odoc/resolver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
open Odoc_utils
open Or_error

type named_root = string * Fs.Directory.t
module Named_roots : sig
type t

Expand All @@ -45,7 +46,7 @@ module Named_roots : sig
omit : Fs.Directory.t list;
}

val create : input list -> current_root:(string * Fs.Directory.t) option -> t
val create : input list -> current_root:named_root option -> t

val all_of : ?root:string -> ext:string -> t -> (Fs.File.t list, error) result

Expand All @@ -71,7 +72,7 @@ end = struct

type t = {
table : (string, pkg) Hashtbl.t;
current_root : (string * Fs.Directory.t) option;
current_root : named_root option;
}

type input = {
Expand Down Expand Up @@ -542,11 +543,12 @@ let all_units ~library ({ libs; _ } : t) =
| Some libs ->
Odoc_utils.List.filter_map filter @@ all_roots ~root:library libs


type roots = {
page_roots : (string * Fs.Directory.t) list;
lib_roots : (string * Fs.Directory.t) list;
current_lib : (string * Fs.Directory.t) option;
current_package : (string * Fs.Directory.t) option;
page_roots : named_root list;
lib_roots : named_root list;
current_lib : named_root option;
current_package : named_root option;
current_dir : Fs.Directory.t;
}

Expand Down
14 changes: 8 additions & 6 deletions src/odoc/resolver.mli
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ open Odoc_model

type t

type named_root = string * Fs.Directory.t

type roots = {
page_roots : (string * Fs.Directory.t) list;
lib_roots : (string * Fs.Directory.t) list;
current_lib : (string * Fs.Directory.t) option;
(** Name of the current [-L]. *)
current_package : (string * Fs.Directory.t) option;
(** Name of the current [-P]. *)
page_roots : named_root list;
lib_roots : named_root list;
current_lib : named_root option;
(** The current [-L]. *)
current_package : named_root option;
(** The current [-P]. *)
current_dir : Fs.Directory.t;
(** Directory containing the output for the current unit. *)
}
Expand Down

0 comments on commit d13d655

Please sign in to comment.