Module Odoc_xref2.Env

type lookup_unit_result =
| Forward_reference
| Found of Odoc_model.Lang.Compilation_unit.t
| Not_found
type lookup_page_result = Odoc_model.Lang.Page.t option
type resolver = {
open_units : string list;
lookup_unit : string -> lookup_unit_result;
lookup_page : string -> lookup_page_result;
}
type lookup_type =
| Module of Odoc_model.Paths.Identifier.Path.Module.t
| ModuleType of Odoc_model.Paths.Identifier.ModuleType.t
| RootModule of string * [ `Forward | `Resolved of Digest.t ] option
| ModuleByName of string * Odoc_model.Paths.Identifier.Path.Module.t
| FragmentRoot of int
val pp_lookup_type_list : Format.formatter -> lookup_type list -> unit
type t
val with_recorded_lookups : t -> (t -> 'a) -> lookup_type list * 'a
val set_resolver : t -> resolver -> t
val has_resolver : t -> bool
val id : t -> int
val empty : t
val add_fragment_root : Component.Signature.t -> t -> t
val add_docs : Odoc_model.Comment.docs -> t -> t
val add_comment : Odoc_model.Comment.docs_or_stop -> t -> t
val add_module_functor_args : Component.Module.t -> Odoc_model.Paths.Identifier.Path.Module.t -> t -> t
val add_module_type_functor_args : Component.ModuleType.t -> Odoc_model.Paths.Identifier.ModuleType.t -> t -> t
val lookup_fragment_root : t -> (int * Component.Signature.t) option
val lookup_page : string -> t -> Odoc_model.Lang.Page.t option
val lookup_root_module : string -> t -> root option
type 'a scope constraint 'a = [< Component.Element.any ]

Target of a lookup

type 'a maybe_ambiguous = ('a[ `Ambiguous of 'a * 'a list | `Not_found ]) Result.result
val lookup_by_name : 'a scope -> string -> t -> 'a maybe_ambiguous

Lookup an element in Env depending on the given scope. Return Error (`Ambiguous _) when two or more elements match the given scope and name.

val lookup_by_id : 'a scope -> [< Odoc_model.Paths.Identifier.t ] -> t -> 'a option

Like lookup_by_name but use an identifier as key.

val add_functor_parameter : Odoc_model.Lang.FunctorParameter.t -> t -> t
val open_class_signature : Odoc_model.Lang.ClassSignature.t -> t -> t
val open_signature : Odoc_model.Lang.Signature.t -> t -> t

Create a new env with a module initially opened.

val env_of_page : Odoc_model.Lang.Page.t -> resolver -> t

Create a new env for a page.

val inherit_resolver : t -> t

Create an empty environment reusing the same resolver.

val len : int ref
val n : int ref
val verify_lookups : t -> lookup_type list -> bool