this repo has no description
at main 91 lines 3.1 kB view raw
1(* 2 * Copyright (c) 2014 Leo White <lpw25@cl.cam.ac.uk> 3 * 4 * Permission to use, copy, modify, and distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 *) 16 17open Odoc_model 18 19type t 20 21val empty : unit -> t 22 23val add_parameter : 24 Paths.Identifier.Signature.t -> Ident.t -> Names.ModuleName.t -> t -> t 25 26val handle_signature_type_items : 27 Paths.Identifier.Signature.t -> Compat.signature -> t -> t 28 29val add_signature_tree_items : 30 Paths.Identifier.Signature.t -> Typedtree.signature -> t -> t 31 32val add_structure_tree_items : 33 Paths.Identifier.Signature.t -> Typedtree.structure -> t -> t 34 35module Path : sig 36 val read_module : t -> Path.t -> Paths.Path.Module.t 37 38 val read_module_type : t -> Path.t -> Paths.Path.ModuleType.t 39 40 val read_type : t -> Path.t -> Paths.Path.Type.t 41 42 val read_class_type : t -> Path.t -> Paths.Path.ClassType.t 43 44 val read_value : t -> Path.t -> Paths.Path.Value.t 45end 46 47val find_module : t -> Ident.t -> Paths.Path.Module.t 48 49val find_module_identifier : t -> Ident.t -> Paths.Identifier.Module.t 50 51val find_parameter_identifier : 52 t -> Ident.t -> Paths.Identifier.FunctorParameter.t 53 54val find_module_type : t -> Ident.t -> Paths.Identifier.ModuleType.t 55 56val find_value_identifier : t -> Ident.t -> Paths.Identifier.Value.t 57 58val find_type : t -> Ident.t -> Paths.Identifier.Path.Type.t option 59 60val find_constructor_identifier : t -> Ident.t -> Paths.Identifier.Constructor.t 61 62val find_extension_identifier : t -> Ident.t -> Paths.Identifier.Extension.t 63 64val find_exception_identifier : t -> Ident.t -> Paths.Identifier.Exception.t 65 66val find_type_identifier : t -> Ident.t -> Paths.Identifier.Type.t 67 68val find_class_identifier : t -> Ident.t -> Paths.Identifier.Class.t 69 70val ident_is_global_or_predef : Ident.t -> bool 71 72val is_shadowed : t -> Ident.t -> bool 73 74val find_class_type_identifier : t -> Ident.t -> Paths.Identifier.ClassType.t 75 76module Fragment : sig 77 val read_module : Longident.t -> Paths.Fragment.Module.t 78 79 val read_module_type : Longident.t -> Paths.Fragment.ModuleType.t 80 81 val read_type : Longident.t -> Paths.Fragment.Type.t 82end 83 84val identifier_of_loc : t -> Location.t -> Paths.Identifier.t option 85(** Each generated id has its location stored. This allows to get back the id 86 knowing only the location. This is used to generate links to source from the 87 resolution of a shape. *) 88 89val iter_located_identifier : 90 t -> (Location.t -> Paths.Identifier.t -> unit) -> unit 91(** Iter on all stored pair [location]-[identifier]. *)