this repo has no description

tidy paths

+184 -809
+4 -8
src/document/url.ml
··· 23 | `Subst (_, p) -> render_resolved (p :> t) 24 | `SubstT (_, p) -> render_resolved (p :> t) 25 | `Alias (dest, `Resolved src) -> 26 - if 27 - Odoc_model.Paths.Path.Resolved.Module.is_hidden 28 - ~weak_canonical_test:false src 29 - then render_resolved (dest :> t) 30 else render_resolved (src :> t) 31 | `Alias (dest, src) -> 32 if Odoc_model.Paths.Path.is_hidden (src :> Path.t) then 33 render_resolved (dest :> t) 34 else render_path (src :> Path.t) 35 | `AliasModuleType (p1, p2) -> 36 - if 37 - Odoc_model.Paths.Path.Resolved.ModuleType.is_hidden 38 - ~weak_canonical_test:false p2 39 - then render_resolved (p1 :> t) 40 else render_resolved (p2 :> t) 41 | `Hidden p -> render_resolved (p :> t) 42 | `Module (p, s) -> render_resolved (p :> t) ^ "." ^ ModuleName.to_string s
··· 23 | `Subst (_, p) -> render_resolved (p :> t) 24 | `SubstT (_, p) -> render_resolved (p :> t) 25 | `Alias (dest, `Resolved src) -> 26 + if Odoc_model.Paths.Path.Resolved.(is_hidden (src :> t)) then 27 + render_resolved (dest :> t) 28 else render_resolved (src :> t) 29 | `Alias (dest, src) -> 30 if Odoc_model.Paths.Path.is_hidden (src :> Path.t) then 31 render_resolved (dest :> t) 32 else render_path (src :> Path.t) 33 | `AliasModuleType (p1, p2) -> 34 + if Odoc_model.Paths.Path.Resolved.(is_hidden (p2 :> t)) then 35 + render_resolved (p1 :> t) 36 else render_resolved (p2 :> t) 37 | `Hidden p -> render_resolved (p :> t) 38 | `Module (p, s) -> render_resolved (p :> t) ^ "." ^ ModuleName.to_string s
+93 -459
src/model/paths.ml
··· 22 module Identifier = struct 23 type 'a id = 'a Paths_types.id = { iv : 'a; ihash : int; ikey : string } 24 25 - type t = Paths_types.Identifier.any 26 27 - type t_pv = Paths_types.Identifier.any_pv 28 29 let rec name_aux : t -> string = 30 fun x -> ··· 52 53 let name : [< t_pv ] id -> string = fun n -> name_aux (n :> t) 54 55 - let rec root id = 56 - match id.iv with 57 - | `Root _ as root -> Some { id with iv = root } 58 - | `Module (parent, _) -> root (parent :> t) 59 - | `Parameter (parent, _) -> root (parent :> t) 60 - | `Result x -> root (x :> t) 61 - | `ModuleType (parent, _) -> root (parent :> t) 62 - | `Type (parent, _) -> root (parent :> t) 63 - | `Constructor (parent, _) -> root (parent :> t) 64 - | `Field (parent, _) -> root (parent :> t) 65 - | `Extension (parent, _) -> root (parent :> t) 66 - | `Exception (parent, _) -> root (parent :> t) 67 - | `Value (parent, _) -> root (parent :> t) 68 - | `Class (parent, _) -> root (parent :> t) 69 - | `ClassType (parent, _) -> root (parent :> t) 70 - | `Method (parent, _) -> root (parent :> t) 71 - | `InstanceVariable (parent, _) -> root (parent :> t) 72 - | `Label (parent, _) -> root (parent :> t) 73 - | `Page _ | `LeafPage _ | `CoreType _ | `CoreException _ -> None 74 - 75 - let root id = root (id :> t) 76 - 77 let rec label_parent_aux = 78 - let open Paths_types.Identifier in 79 - fun (n : any) -> 80 match n with 81 | { iv = `Result i; _ } -> label_parent_aux (i :> any) 82 | { iv = `CoreType _; _ } | { iv = `CoreException _; _ } -> assert false ··· 109 110 type any = t 111 112 module Any = struct 113 type t = any 114 - 115 let equal = equal 116 - 117 let hash = hash 118 - 119 let compare = compare 120 end 121 122 module Signature = struct 123 - type t = Paths_types.Identifier.signature 124 - 125 - type t_pv = Paths_types.Identifier.signature_pv 126 - 127 let equal = equal 128 - 129 let hash = hash 130 - 131 let compare = compare 132 - 133 - let rec root = function 134 - | { iv = `Root _; _ } as root -> root 135 - | { 136 - iv = 137 - ( `ModuleType (parent, _) 138 - | `Module (parent, _) 139 - | `Parameter (parent, _) ); 140 - _; 141 - } -> 142 - root parent 143 - | { iv = `Result x; _ } -> root x 144 - 145 - let root id = root (id :> t) 146 end 147 148 module ClassSignature = struct 149 - type t = Paths_types.Identifier.class_signature 150 - 151 - type t_pv = Paths_types.Identifier.class_signature_pv 152 - 153 let equal = equal 154 - 155 let hash = hash 156 - 157 let compare = compare 158 end 159 160 module DataType = struct 161 - type t = Paths_types.Identifier.datatype 162 - 163 - type t_pv = Paths_types.Identifier.datatype_pv 164 - 165 - let equal = equal 166 - 167 - let hash = hash 168 - 169 - let compare = compare 170 end 171 172 module Parent = struct 173 - type t = Paths_types.Identifier.parent 174 - 175 - type t_pv = Paths_types.Identifier.parent_pv 176 - 177 - let equal = equal 178 - 179 - let hash = hash 180 - 181 - let compare = compare 182 end 183 184 module LabelParent = struct 185 - type t = Paths_types.Identifier.label_parent 186 - 187 - type t_pv = Paths_types.Identifier.label_parent_pv 188 - 189 let equal = equal 190 - 191 let hash = hash 192 - 193 let compare = compare 194 end 195 196 module RootModule = struct 197 - type t = Paths_types.Identifier.root_module 198 - 199 - type t_pv = Paths_types.Identifier.root_module_pv 200 - 201 let equal = equal 202 - 203 let hash = hash 204 - 205 let compare = compare 206 - 207 - let name { iv = `Root (_, name); _ } = ModuleName.to_string name 208 end 209 210 module Module = struct 211 - type t = Paths_types.Identifier.module_ 212 - 213 - type t_pv = Paths_types.Identifier.module_pv 214 - 215 let equal = equal 216 - 217 let hash = hash 218 - 219 let compare = compare 220 - 221 - let root id = Signature.root (id :> Signature.t) 222 end 223 224 module FunctorParameter = struct 225 - type t = Paths_types.Identifier.functor_parameter 226 - 227 - type t_pv = Paths_types.Identifier.functor_parameter_pv 228 - 229 let equal = equal 230 - 231 let hash = hash 232 - 233 let compare = compare 234 end 235 236 module FunctorResult = struct 237 - type t = Paths_types.Identifier.functor_result 238 - 239 - type t_pv = Paths_types.Identifier.functor_result_pv 240 - 241 - let equal = equal 242 - 243 - let hash = hash 244 - 245 - let compare = compare 246 end 247 248 module ModuleType = struct 249 - type t = Paths_types.Identifier.module_type 250 - 251 - type t_pv = Paths_types.Identifier.module_type_pv 252 - 253 let equal = equal 254 - 255 let hash = hash 256 - 257 let compare = compare 258 end 259 260 module Type = struct 261 - type t = Paths_types.Identifier.type_ 262 - 263 - type t_pv = Paths_types.Identifier.type_pv 264 - 265 let equal = equal 266 - 267 let hash = hash 268 - 269 let compare = compare 270 end 271 272 module Constructor = struct 273 - type t = Paths_types.Identifier.constructor 274 - 275 - type t_pv = Paths_types.Identifier.constructor_pv 276 - 277 - let equal = equal 278 - 279 - let hash = hash 280 - 281 - let compare = compare 282 end 283 284 module Field = struct 285 - type t = Paths_types.Identifier.field 286 - 287 - type t_pv = Paths_types.Identifier.field_pv 288 - 289 - let equal = equal 290 - 291 - let hash = hash 292 - 293 - let compare = compare 294 end 295 296 module Extension = struct 297 - type t = Paths_types.Identifier.extension 298 - 299 - type t_pv = Paths_types.Identifier.extension_pv 300 - 301 - let equal = equal 302 - 303 - let hash = hash 304 - 305 - let compare = compare 306 end 307 308 module Exception = struct 309 - type t = Paths_types.Identifier.exception_ 310 - 311 - type t_pv = Paths_types.Identifier.exception_pv 312 - 313 - let equal = equal 314 - 315 - let hash = hash 316 - 317 - let compare = compare 318 end 319 320 module Value = struct 321 - type t = Paths_types.Identifier.value 322 - 323 - type t_pv = Paths_types.Identifier.value_pv 324 - 325 - let equal = equal 326 - 327 - let hash = hash 328 - 329 - let compare = compare 330 end 331 332 module Class = struct 333 - type t = Paths_types.Identifier.class_ 334 - 335 - type t_pv = Paths_types.Identifier.class_pv 336 - 337 let equal = equal 338 - 339 let hash = hash 340 - 341 let compare = compare 342 end 343 344 module ClassType = struct 345 - type t = Paths_types.Identifier.class_type 346 - 347 - type t_pv = Paths_types.Identifier.class_type_pv 348 - 349 let equal = equal 350 - 351 let hash = hash 352 - 353 let compare = compare 354 end 355 356 module Method = struct 357 - type t = Paths_types.Identifier.method_ 358 - 359 - type t_pv = Paths_types.Identifier.method_pv 360 - 361 - let equal = equal 362 - 363 - let hash = hash 364 - 365 - let compare = compare 366 end 367 368 module InstanceVariable = struct 369 - type t = Paths_types.Identifier.instance_variable 370 - 371 - type t_pv = Paths_types.Identifier.instance_variable_pv 372 - 373 - let equal = equal 374 - 375 - let hash = hash 376 - 377 - let compare = compare 378 end 379 380 module Label = struct 381 type t = Paths_types.Identifier.label 382 - 383 type t_pv = Paths_types.Identifier.label_pv 384 - 385 let equal = equal 386 - 387 let hash = hash 388 - 389 let compare = compare 390 end 391 392 module Page = struct 393 - type t = Paths_types.Identifier.page 394 - 395 - type t_pv = Paths_types.Identifier.page_pv 396 - 397 - let equal = equal 398 - 399 - let hash = hash 400 - 401 - let compare = compare 402 end 403 404 module ContainerPage = struct 405 - type t = Paths_types.Identifier.container_page 406 - 407 - type t_pv = Paths_types.Identifier.container_page_pv 408 - 409 - let equal = equal 410 - 411 - let hash = hash 412 - 413 - let compare = compare 414 end 415 416 module SourceDir = struct 417 - type t = Paths_types.Identifier.source_dir 418 - type t_pv = Paths_types.Identifier.source_dir_pv 419 let equal = equal 420 let hash = hash 421 let compare = compare ··· 425 end 426 427 module SourcePage = struct 428 - type t = Paths_types.Identifier.source_page 429 - type t_pv = Paths_types.Identifier.source_page_pv 430 let equal = equal 431 - let hash = hash 432 - let compare = compare 433 let name { iv = `SourcePage (p, name); _ } = SourceDir.name p ^ name 434 end 435 436 module OdocId = struct 437 - type t = Paths_types.Identifier.odoc_id 438 - 439 - type t_pv = Paths_types.Identifier.odoc_id_pv 440 - 441 - let equal = equal 442 - 443 - let hash = hash 444 - 445 - let compare = compare 446 end 447 448 module Path = struct 449 module Module = struct 450 - type t = Paths_types.Identifier.path_module 451 - 452 - type t_pv = Paths_types.Identifier.path_module_pv 453 - 454 let equal = equal 455 - 456 let hash = hash 457 - 458 let compare = compare 459 - 460 - let root id = Signature.root (id :> Signature.t) 461 end 462 463 module ModuleType = struct 464 - type t = Paths_types.Identifier.path_module_type 465 - 466 let equal = equal 467 - 468 let hash = hash 469 - 470 let compare = compare 471 end 472 473 module Type = struct 474 - type t = Paths_types.Identifier.path_type 475 - 476 - type t_pv = Paths_types.Identifier.path_type_pv 477 - 478 let equal = equal 479 - 480 let hash = hash 481 - 482 let compare = compare 483 end 484 485 module ClassType = struct 486 - type t = Paths_types.Identifier.path_class_type 487 - 488 - type t_pv = Paths_types.Identifier.path_class_type_pv 489 - 490 let equal = equal 491 - 492 let hash = hash 493 - 494 let compare = compare 495 end 496 497 - type t = Paths_types.Identifier.path_any 498 end 499 500 module Maps = struct ··· 774 775 let is_hidden m = 776 is_resolved_hidden (m : t :> Paths_types.Resolved_path.any) 777 - 778 - let rec identifier : t -> Identifier.Path.Module.t = 779 - fun x -> 780 - let r = identifier in 781 - match x with 782 - | `Identifier id -> id 783 - | `Subst (_, x) -> r x 784 - | `Hidden p -> r p 785 - | `Module (m, n) -> Identifier.Mk.module_ (parent_module_identifier m, n) 786 - | `Canonical (p, _) -> r p 787 - | `Apply (m, _) -> r m 788 - | `Alias (dest, _src) -> r dest 789 - | `OpaqueModule m -> r m 790 - 791 - let rec root : t -> string option = function 792 - | `Identifier id -> ( 793 - match Identifier.root (id :> Identifier.t) with 794 - | Some root -> Some (Identifier.name root) 795 - | None -> None) 796 - | `Subst (_, p) 797 - | `Hidden p 798 - | `Module (p, _) 799 - | `Canonical (p, _) 800 - | `Apply (p, _) 801 - | `Alias (p, _) 802 - | `OpaqueModule p -> 803 - root p 804 end 805 806 module ModuleType = struct 807 type t = Paths_types.Resolved_path.module_type 808 - 809 - let is_hidden m = 810 - is_resolved_hidden (m : t :> Paths_types.Resolved_path.any) 811 end 812 813 module Type = struct 814 type t = Paths_types.Resolved_path.type_ 815 - 816 - let of_ident id = `Identifier id 817 - 818 - let is_hidden m = 819 - is_resolved_hidden ~weak_canonical_test:false 820 - (m : t :> Paths_types.Resolved_path.any) 821 end 822 823 module ClassType = struct 824 type t = Paths_types.Resolved_path.class_type 825 - 826 - let of_ident id = `Identifier id 827 - 828 - let is_hidden m = 829 - is_resolved_hidden ~weak_canonical_test:false 830 - (m : t :> Paths_types.Resolved_path.any) 831 end 832 833 let rec identifier : t -> Identifier.t = function ··· 866 867 module Module = struct 868 type t = Paths_types.Path.module_ 869 - 870 - let rec root : t -> string option = function 871 - | `Resolved r -> Resolved.Module.root r 872 - | `Identifier (id, _) -> ( 873 - match Identifier.root (id :> Identifier.t) with 874 - | Some root -> Some (Identifier.name root) 875 - | None -> None) 876 - | `Root s -> Some s 877 - | `Forward _ -> None 878 - | `Dot (p, _) | `Apply (p, _) -> root p 879 end 880 881 module ModuleType = struct ··· 899 900 type root = Paths_types.Resolved_fragment.root 901 902 - let sig_of_mod m = 903 - let open Paths_types.Resolved_fragment in 904 - (m : module_ :> signature) 905 - 906 - type base_name = 907 - | Base of root 908 - | Branch of ModuleName.t * Paths_types.Resolved_fragment.signature 909 - 910 - let rec split_parent : Paths_types.Resolved_fragment.signature -> base_name 911 - = function 912 - | `Root i -> Base i 913 - | `Subst (_, p) -> split_parent (sig_of_mod p) 914 - | `Alias (_, p) -> split_parent (sig_of_mod p) 915 - | `OpaqueModule m -> split_parent (sig_of_mod m) 916 - | `Module (p, name) -> ( 917 - match split_parent p with 918 - | Base i -> Branch (name, `Root i) 919 - | Branch (base, m) -> Branch (base, `Module (m, name))) 920 - 921 module Signature = struct 922 type t = Paths_types.Resolved_fragment.signature 923 924 - let rec split : t -> string * t option = function 925 - | `Root _ -> ("", None) 926 - | `Subst (_, p) -> split (sig_of_mod p) 927 - | `Alias (_, p) -> split (sig_of_mod p) 928 - | `OpaqueModule m -> split (sig_of_mod m) 929 - | `Module (m, name) -> ( 930 - match split_parent m with 931 - | Base _ -> (ModuleName.to_string name, None) 932 - | Branch (base, m) -> 933 - (ModuleName.to_string base, Some (`Module (m, name)))) 934 - 935 - let rec identifier : t -> Identifier.Signature.t = function 936 | `Root (`ModuleType i) -> Path.Resolved.parent_module_type_identifier i 937 | `Root (`Module i) -> Path.Resolved.parent_module_identifier i 938 | `Subst (s, _) -> Path.Resolved.parent_module_type_identifier s 939 | `Alias (i, _) -> Path.Resolved.parent_module_identifier i 940 - | `Module (m, n) -> Identifier.Mk.module_ (identifier m, n) 941 - | `OpaqueModule m -> identifier (sig_of_mod m) 942 end 943 944 module Module = struct 945 type t = Paths_types.Resolved_fragment.module_ 946 - 947 - let rec split : t -> string * t option = function 948 - | `Subst (_, p) -> split p 949 - | `Alias (_, p) -> split p 950 - | `Module (m, name) -> ( 951 - match split_parent m with 952 - | Base _ -> (ModuleName.to_string name, None) 953 - | Branch (base, m) -> 954 - (ModuleName.to_string base, Some (`Module (m, name)))) 955 - | `OpaqueModule m -> split m 956 end 957 958 module ModuleType = struct 959 type t = Paths_types.Resolved_fragment.module_type 960 - 961 - let split : t -> string * t option = function 962 - | `Module_type (m, name) -> ( 963 - match split_parent m with 964 - | Base _ -> (ModuleTypeName.to_string name, None) 965 - | Branch (base, m) -> 966 - (ModuleName.to_string base, Some (`Module_type (m, name)))) 967 end 968 969 module Type = struct 970 type t = Paths_types.Resolved_fragment.type_ 971 - 972 - let split : t -> string * t option = function 973 - | `Type (m, name) -> ( 974 - match split_parent m with 975 - | Base _ -> (TypeName.to_string name, None) 976 - | Branch (base, m) -> 977 - (ModuleName.to_string base, Some (`Type (m, name)))) 978 - | `Class (m, name) -> ( 979 - match split_parent m with 980 - | Base _ -> (ClassName.to_string name, None) 981 - | Branch (base, m) -> 982 - (ModuleName.to_string base, Some (`Class (m, name)))) 983 - | `ClassType (m, name) -> ( 984 - match split_parent m with 985 - | Base _ -> (ClassTypeName.to_string name, None) 986 - | Branch (base, m) -> 987 - (ModuleName.to_string base, Some (`ClassType (m, name)))) 988 end 989 990 type leaf = Paths_types.Resolved_fragment.leaf ··· 995 | `Subst (s, _) -> Path.Resolved.identifier (s :> Path.Resolved.t) 996 | `Alias (p, _) -> 997 (Path.Resolved.parent_module_identifier p :> Identifier.t) 998 - | `Module (m, n) -> Identifier.Mk.module_ (Signature.identifier m, n) 999 | `Module_type (m, n) -> 1000 - Identifier.Mk.module_type (Signature.identifier m, n) 1001 - | `Type (m, n) -> Identifier.Mk.type_ (Signature.identifier m, n) 1002 - | `Class (m, n) -> Identifier.Mk.class_ (Signature.identifier m, n) 1003 - | `ClassType (m, n) -> Identifier.Mk.class_type (Signature.identifier m, n) 1004 | `OpaqueModule m -> identifier (m :> t) 1005 1006 let rec is_hidden : t -> bool = function 1007 - | `Root (`ModuleType r) -> 1008 - Path.is_resolved_hidden ~weak_canonical_test:false 1009 - (r :> Path.Resolved.t) 1010 - | `Root (`Module r) -> 1011 - Path.is_resolved_hidden ~weak_canonical_test:false 1012 - (r :> Path.Resolved.t) 1013 - | `Subst (s, _) -> 1014 - Path.is_resolved_hidden ~weak_canonical_test:false 1015 - (s :> Path.Resolved.t) 1016 - | `Alias (s, _) -> 1017 - Path.is_resolved_hidden ~weak_canonical_test:false 1018 - (s :> Path.Resolved.t) 1019 | `Module (m, _) 1020 | `Module_type (m, _) 1021 | `Type (m, _) ··· 1026 end 1027 1028 type t = Paths_types.Fragment.any 1029 - 1030 - type base_name = 1031 - | Base of Resolved.root option 1032 - | Branch of ModuleName.t * Paths_types.Fragment.signature 1033 - 1034 - let rec split_parent : Paths_types.Fragment.signature -> base_name = function 1035 - | `Root -> Base None 1036 - | `Resolved r -> ( 1037 - match Resolved.split_parent r with 1038 - | Resolved.Base i -> Base (Some i) 1039 - | Resolved.Branch (base, m) -> Branch (base, `Resolved m)) 1040 - | `Dot (m, name) -> ( 1041 - match split_parent m with 1042 - | Base None -> Branch (ModuleName.make_std name, `Root) 1043 - | Base (Some i) -> Branch (ModuleName.make_std name, `Resolved (`Root i)) 1044 - | Branch (base, m) -> Branch (base, `Dot (m, name))) 1045 1046 module Signature = struct 1047 type t = Paths_types.Fragment.signature 1048 - 1049 - let split : t -> string * t option = function 1050 - | `Root -> ("", None) 1051 - | `Resolved r -> 1052 - let base, m = Resolved.Signature.split r in 1053 - let m = match m with None -> None | Some m -> Some (`Resolved m) in 1054 - (base, m) 1055 - | `Dot (m, name) -> ( 1056 - match split_parent m with 1057 - | Base _ -> (name, None) 1058 - | Branch (base, m) -> 1059 - (ModuleName.to_string base, Some (`Dot (m, name)))) 1060 end 1061 1062 module Module = struct 1063 type t = Paths_types.Fragment.module_ 1064 - 1065 - let split : t -> string * t option = function 1066 - | `Resolved r -> 1067 - let base, m = Resolved.Module.split r in 1068 - let m = match m with None -> None | Some m -> Some (`Resolved m) in 1069 - (base, m) 1070 - | `Dot (m, name) -> ( 1071 - match split_parent m with 1072 - | Base _ -> (name, None) 1073 - | Branch (base, m) -> 1074 - (ModuleName.to_string base, Some (`Dot (m, name)))) 1075 end 1076 1077 module ModuleType = struct 1078 type t = Paths_types.Fragment.module_type 1079 - 1080 - let split : t -> string * t option = function 1081 - | `Resolved r -> 1082 - let base, m = Resolved.ModuleType.split r in 1083 - let m = match m with None -> None | Some m -> Some (`Resolved m) in 1084 - (base, m) 1085 - | `Dot (m, name) -> ( 1086 - match split_parent m with 1087 - | Base _ -> (name, None) 1088 - | Branch (base, m) -> 1089 - (ModuleName.to_string base, Some (`Dot (m, name)))) 1090 end 1091 1092 module Type = struct 1093 type t = Paths_types.Fragment.type_ 1094 - 1095 - let split : t -> string * t option = function 1096 - | `Resolved r -> 1097 - let base, m = Resolved.Type.split r in 1098 - let m = match m with None -> None | Some m -> Some (`Resolved m) in 1099 - (base, m) 1100 - | `Dot (m, name) -> ( 1101 - match split_parent m with 1102 - | Base _ -> (name, None) 1103 - | Branch (base, m) -> 1104 - (ModuleName.to_string base, Some (`Dot (m, name)))) 1105 end 1106 1107 type leaf = Paths_types.Fragment.leaf ··· 1118 | `Identifier id -> id 1119 | `Hidden s -> parent_signature_identifier (s :> signature) 1120 | `Alias (sub, orig) -> 1121 - if Path.Resolved.Module.is_hidden ~weak_canonical_test:false sub then 1122 parent_signature_identifier (orig :> signature) 1123 else 1124 (Path.Resolved.parent_module_identifier sub 1125 :> Identifier.Signature.t) 1126 | `AliasModuleType (sub, orig) -> 1127 - if Path.Resolved.ModuleType.is_hidden ~weak_canonical_test:false sub 1128 - then parent_signature_identifier (orig :> signature) 1129 else 1130 (Path.Resolved.parent_module_type_identifier sub 1131 :> Identifier.Signature.t)
··· 22 module Identifier = struct 23 type 'a id = 'a Paths_types.id = { iv : 'a; ihash : int; ikey : string } 24 25 + module Id = Paths_types.Identifier 26 27 + type t = Id.any 28 + 29 + type t_pv = Id.any_pv 30 31 let rec name_aux : t -> string = 32 fun x -> ··· 54 55 let name : [< t_pv ] id -> string = fun n -> name_aux (n :> t) 56 57 let rec label_parent_aux = 58 + let open Id in 59 + fun (n : t) -> 60 match n with 61 | { iv = `Result i; _ } -> label_parent_aux (i :> any) 62 | { iv = `CoreType _; _ } | { iv = `CoreException _; _ } -> assert false ··· 89 90 type any = t 91 92 + type any_pv = t_pv 93 + 94 + module type IdSig = sig 95 + type t 96 + type t_pv 97 + val equal : t -> t -> bool 98 + val hash : t -> int 99 + val compare : t -> t -> int 100 + end 101 + 102 module Any = struct 103 type t = any 104 + type t_pv = any_pv 105 let equal = equal 106 let hash = hash 107 let compare = compare 108 end 109 110 module Signature = struct 111 + type t = Id.signature 112 + type t_pv = Id.signature_pv 113 let equal = equal 114 let hash = hash 115 let compare = compare 116 end 117 118 module ClassSignature = struct 119 + type t = Id.class_signature 120 + type t_pv = Id.class_signature_pv 121 let equal = equal 122 let hash = hash 123 let compare = compare 124 end 125 126 module DataType = struct 127 + type t = Id.datatype 128 + type t_pv = Id.datatype_pv 129 end 130 131 module Parent = struct 132 + type t = Id.parent 133 + type t_pv = Id.parent_pv 134 end 135 136 module LabelParent = struct 137 + type t = Id.label_parent 138 + type t_pv = Id.label_parent_pv 139 let equal = equal 140 let hash = hash 141 let compare = compare 142 end 143 144 module RootModule = struct 145 + type t = Id.root_module 146 + type t_pv = Id.root_module_pv 147 let equal = equal 148 let hash = hash 149 let compare = compare 150 end 151 152 module Module = struct 153 + type t = Id.module_ 154 + type t_pv = Id.module_pv 155 let equal = equal 156 let hash = hash 157 let compare = compare 158 end 159 160 module FunctorParameter = struct 161 + type t = Id.functor_parameter 162 + type t_pv = Id.functor_parameter_pv 163 let equal = equal 164 let hash = hash 165 let compare = compare 166 end 167 168 module FunctorResult = struct 169 + type t = Id.functor_result 170 + type t_pv = Id.functor_result_pv 171 end 172 173 module ModuleType = struct 174 + type t = Id.module_type 175 + type t_pv = Id.module_type_pv 176 let equal = equal 177 let hash = hash 178 let compare = compare 179 end 180 181 module Type = struct 182 + type t = Id.type_ 183 + type t_pv = Id.type_pv 184 let equal = equal 185 let hash = hash 186 let compare = compare 187 end 188 189 module Constructor = struct 190 + type t = Id.constructor 191 + type t_pv = Id.constructor_pv 192 end 193 194 module Field = struct 195 + type t = Id.field 196 + type t_pv = Id.field_pv 197 end 198 199 module Extension = struct 200 + type t = Id.extension 201 + type t_pv = Id.extension_pv 202 end 203 204 module Exception = struct 205 + type t = Id.exception_ 206 + type t_pv = Id.exception_pv 207 end 208 209 module Value = struct 210 + type t = Id.value 211 + type t_pv = Id.value_pv 212 end 213 214 module Class = struct 215 + type t = Id.class_ 216 + type t_pv = Id.class_pv 217 let equal = equal 218 let hash = hash 219 let compare = compare 220 end 221 222 module ClassType = struct 223 + type t = Id.class_type 224 + type t_pv = Id.class_type_pv 225 let equal = equal 226 let hash = hash 227 let compare = compare 228 end 229 230 module Method = struct 231 + type t = Id.method_ 232 + type t_pv = Id.method_pv 233 end 234 235 module InstanceVariable = struct 236 + type t = Id.instance_variable 237 + type t_pv = Id.instance_variable_pv 238 end 239 240 module Label = struct 241 type t = Paths_types.Identifier.label 242 type t_pv = Paths_types.Identifier.label_pv 243 let equal = equal 244 let hash = hash 245 let compare = compare 246 end 247 248 module Page = struct 249 + type t = Id.page 250 + type t_pv = Id.page_pv 251 end 252 253 module ContainerPage = struct 254 + type t = Id.container_page 255 + type t_pv = Id.container_page_pv 256 end 257 258 module SourceDir = struct 259 + type t = Id.source_dir 260 + type t_pv = Id.source_dir_pv 261 let equal = equal 262 let hash = hash 263 let compare = compare ··· 267 end 268 269 module SourcePage = struct 270 + type t = Id.source_page 271 + type t_pv = Id.source_page_pv 272 let equal = equal 273 let name { iv = `SourcePage (p, name); _ } = SourceDir.name p ^ name 274 + 275 end 276 277 module OdocId = struct 278 + type t = Id.odoc_id 279 + type t_pv = Id.odoc_id_pv 280 end 281 282 module Path = struct 283 module Module = struct 284 + type t = Id.path_module 285 + type t_pv = Id.path_module_pv 286 let equal = equal 287 let hash = hash 288 let compare = compare 289 end 290 291 module ModuleType = struct 292 + type t = Id.path_module_type 293 + type t_pv = Id.module_type_pv 294 let equal = equal 295 let hash = hash 296 let compare = compare 297 end 298 299 module Type = struct 300 + type t = Id.path_type 301 + type t_pv = Id.path_type_pv 302 let equal = equal 303 let hash = hash 304 let compare = compare 305 end 306 307 module ClassType = struct 308 + type t = Id.path_class_type 309 + type t_pv = Id.path_class_type_pv 310 let equal = equal 311 let hash = hash 312 let compare = compare 313 end 314 315 + type t = Id.path_any 316 end 317 318 module Maps = struct ··· 592 593 let is_hidden m = 594 is_resolved_hidden (m : t :> Paths_types.Resolved_path.any) 595 end 596 597 module ModuleType = struct 598 type t = Paths_types.Resolved_path.module_type 599 end 600 601 module Type = struct 602 type t = Paths_types.Resolved_path.type_ 603 end 604 605 module ClassType = struct 606 type t = Paths_types.Resolved_path.class_type 607 end 608 609 let rec identifier : t -> Identifier.t = function ··· 642 643 module Module = struct 644 type t = Paths_types.Path.module_ 645 end 646 647 module ModuleType = struct ··· 665 666 type root = Paths_types.Resolved_fragment.root 667 668 module Signature = struct 669 type t = Paths_types.Resolved_fragment.signature 670 671 + let rec sgidentifier : t -> Identifier.Signature.t = function 672 | `Root (`ModuleType i) -> Path.Resolved.parent_module_type_identifier i 673 | `Root (`Module i) -> Path.Resolved.parent_module_identifier i 674 | `Subst (s, _) -> Path.Resolved.parent_module_type_identifier s 675 | `Alias (i, _) -> Path.Resolved.parent_module_identifier i 676 + | `Module (m, n) -> Identifier.Mk.module_ (sgidentifier m, n) 677 + | `OpaqueModule m -> sgidentifier (m :> t) 678 end 679 680 module Module = struct 681 type t = Paths_types.Resolved_fragment.module_ 682 end 683 684 module ModuleType = struct 685 type t = Paths_types.Resolved_fragment.module_type 686 end 687 688 module Type = struct 689 type t = Paths_types.Resolved_fragment.type_ 690 end 691 692 type leaf = Paths_types.Resolved_fragment.leaf ··· 697 | `Subst (s, _) -> Path.Resolved.identifier (s :> Path.Resolved.t) 698 | `Alias (p, _) -> 699 (Path.Resolved.parent_module_identifier p :> Identifier.t) 700 + | `Module (m, n) -> Identifier.Mk.module_ (Signature.sgidentifier m, n) 701 | `Module_type (m, n) -> 702 + Identifier.Mk.module_type (Signature.sgidentifier m, n) 703 + | `Type (m, n) -> Identifier.Mk.type_ (Signature.sgidentifier m, n) 704 + | `Class (m, n) -> Identifier.Mk.class_ (Signature.sgidentifier m, n) 705 + | `ClassType (m, n) -> 706 + Identifier.Mk.class_type (Signature.sgidentifier m, n) 707 | `OpaqueModule m -> identifier (m :> t) 708 709 let rec is_hidden : t -> bool = function 710 + | `Root (`ModuleType r) -> Path.Resolved.(is_hidden (r :> t)) 711 + | `Root (`Module r) -> Path.Resolved.(is_hidden (r :> t)) 712 + | `Subst (s, _) -> Path.Resolved.(is_hidden (s :> t)) 713 + | `Alias (s, _) -> Path.Resolved.(is_hidden (s :> t)) 714 | `Module (m, _) 715 | `Module_type (m, _) 716 | `Type (m, _) ··· 721 end 722 723 type t = Paths_types.Fragment.any 724 725 module Signature = struct 726 type t = Paths_types.Fragment.signature 727 end 728 729 module Module = struct 730 type t = Paths_types.Fragment.module_ 731 end 732 733 module ModuleType = struct 734 type t = Paths_types.Fragment.module_type 735 end 736 737 module Type = struct 738 type t = Paths_types.Fragment.type_ 739 end 740 741 type leaf = Paths_types.Fragment.leaf ··· 752 | `Identifier id -> id 753 | `Hidden s -> parent_signature_identifier (s :> signature) 754 | `Alias (sub, orig) -> 755 + if Path.Resolved.(is_hidden (sub :> t)) then 756 parent_signature_identifier (orig :> signature) 757 else 758 (Path.Resolved.parent_module_identifier sub 759 :> Identifier.Signature.t) 760 | `AliasModuleType (sub, orig) -> 761 + if Path.Resolved.(is_hidden (sub :> t)) then 762 + parent_signature_identifier (orig :> signature) 763 else 764 (Path.Resolved.parent_module_type_identifier sub 765 :> Identifier.Signature.t)
+82 -333
src/model/paths.mli
··· 24 25 type 'a id = 'a Paths_types.id = { iv : 'a; ihash : int; ikey : string } 26 27 - module Any : sig 28 - type t = Paths_types.Identifier.any 29 - 30 val equal : t -> t -> bool 31 - 32 val hash : t -> int 33 - 34 val compare : t -> t -> int 35 end 36 37 - module RootModule : sig 38 - type t = Paths_types.Identifier.root_module 39 40 - type t_pv = Paths_types.Identifier.root_module_pv 41 42 - val equal : t -> t -> bool 43 44 - val hash : t -> int 45 46 - val compare : t -> t -> int 47 48 - val name : t -> string 49 - end 50 51 - module Signature : sig 52 - type t = Paths_types.Identifier.signature 53 54 - type t_pv = Paths_types.Identifier.signature_pv 55 56 - val equal : t -> t -> bool 57 58 - val hash : t -> int 59 60 - val compare : t -> t -> int 61 62 - val root : [< t_pv ] id -> RootModule.t 63 end 64 65 - module ClassSignature : sig 66 - type t = Paths_types.Identifier.class_signature 67 - 68 - type t_pv = Paths_types.Identifier.class_signature_pv 69 - 70 - val equal : t -> t -> bool 71 - 72 - val hash : t -> int 73 74 - val compare : t -> t -> int 75 - end 76 77 module DataType : sig 78 - type t = Paths_types.Identifier.datatype 79 - 80 - type t_pv = Paths_types.Identifier.datatype_pv 81 - 82 - val equal : t -> t -> bool 83 - 84 - val hash : t -> int 85 - 86 - val compare : t -> t -> int 87 end 88 - 89 module Parent : sig 90 - type t = Paths_types.Identifier.parent 91 - 92 - type t_pv = Paths_types.Identifier.parent_pv 93 - 94 - val equal : t -> t -> bool 95 - 96 - val hash : t -> int 97 - 98 - val compare : t -> t -> int 99 - end 100 - 101 - module LabelParent : sig 102 - type t = Paths_types.Identifier.label_parent 103 - 104 - type t_pv = Paths_types.Identifier.label_parent_pv 105 - 106 - val equal : t -> t -> bool 107 - 108 - val hash : t -> int 109 - 110 - val compare : t -> t -> int 111 - end 112 - 113 - module Module : sig 114 - type t = Paths_types.Identifier.module_ 115 - 116 - type t_pv = Paths_types.Identifier.module_pv 117 - 118 - val equal : t -> t -> bool 119 - 120 - val hash : t -> int 121 - 122 - val compare : t -> t -> int 123 - 124 - val root : t -> RootModule.t 125 - end 126 - 127 - module FunctorParameter : sig 128 - type t = Paths_types.Identifier.functor_parameter 129 - 130 - type t_pv = Paths_types.Identifier.functor_parameter_pv 131 - 132 - val equal : t -> t -> bool 133 - 134 - val hash : t -> int 135 - 136 - val compare : t -> t -> int 137 end 138 139 module FunctorResult : sig 140 - type t = Paths_types.Identifier.functor_result 141 - 142 - type t_pv = Paths_types.Identifier.functor_result_pv 143 - 144 - val equal : t -> t -> bool 145 - 146 - val hash : t -> int 147 - 148 - val compare : t -> t -> int 149 - end 150 - 151 - module ModuleType : sig 152 - type t = Paths_types.Identifier.module_type 153 - 154 - type t_pv = Paths_types.Identifier.module_type_pv 155 - 156 - val equal : t -> t -> bool 157 - 158 - val hash : t -> int 159 - 160 - val compare : t -> t -> int 161 - end 162 - 163 - module Type : sig 164 - type t = Paths_types.Identifier.type_ 165 - 166 - type t_pv = Paths_types.Identifier.type_pv 167 - 168 - val equal : t -> t -> bool 169 - 170 - val hash : t -> int 171 - 172 - val compare : t -> t -> int 173 end 174 175 module Constructor : sig 176 - type t = Paths_types.Identifier.constructor 177 - 178 - type t_pv = Paths_types.Identifier.constructor_pv 179 - 180 - val equal : t -> t -> bool 181 - 182 - val hash : t -> int 183 - 184 - val compare : t -> t -> int 185 end 186 187 module Field : sig 188 - type t = Paths_types.Identifier.field 189 - 190 - type t_pv = Paths_types.Identifier.field_pv 191 - 192 - val equal : t -> t -> bool 193 - 194 - val hash : t -> int 195 - 196 - val compare : t -> t -> int 197 end 198 199 module Extension : sig 200 - type t = Paths_types.Identifier.extension 201 - 202 - type t_pv = Paths_types.Identifier.extension_pv 203 - 204 - val equal : t -> t -> bool 205 - 206 - val hash : t -> int 207 - 208 - val compare : t -> t -> int 209 end 210 211 module Exception : sig 212 - type t = Paths_types.Identifier.exception_ 213 - 214 - type t_pv = Paths_types.Identifier.exception_pv 215 - 216 - val equal : t -> t -> bool 217 - 218 - val hash : t -> int 219 - 220 - val compare : t -> t -> int 221 end 222 223 module Value : sig 224 - type t = Paths_types.Identifier.value 225 - 226 - type t_pv = Paths_types.Identifier.value_pv 227 - 228 - val equal : t -> t -> bool 229 - 230 - val hash : t -> int 231 - 232 - val compare : t -> t -> int 233 - end 234 - 235 - module Class : sig 236 - type t = Paths_types.Identifier.class_ 237 - 238 - type t_pv = Paths_types.Identifier.class_pv 239 - 240 - val equal : t -> t -> bool 241 - 242 - val hash : t -> int 243 - 244 - val compare : t -> t -> int 245 - end 246 - 247 - module ClassType : sig 248 - type t = Paths_types.Identifier.class_type 249 - 250 - type t_pv = Paths_types.Identifier.class_type_pv 251 - 252 - val equal : t -> t -> bool 253 - 254 - val hash : t -> int 255 - 256 - val compare : t -> t -> int 257 end 258 259 module Method : sig 260 - type t = Paths_types.Identifier.method_ 261 - 262 - type t_pv = Paths_types.Identifier.method_pv 263 - 264 - val equal : t -> t -> bool 265 - 266 - val hash : t -> int 267 - 268 - val compare : t -> t -> int 269 end 270 271 module InstanceVariable : sig 272 - type t = Paths_types.Identifier.instance_variable 273 - 274 - type t_pv = Paths_types.Identifier.instance_variable_pv 275 - 276 - val equal : t -> t -> bool 277 - 278 - val hash : t -> int 279 - 280 - val compare : t -> t -> int 281 - end 282 - 283 - module Label : sig 284 - type t = Paths_types.Identifier.label 285 - 286 - type t_pv = Paths_types.Identifier.label_pv 287 - 288 - val equal : t -> t -> bool 289 - 290 - val hash : t -> int 291 - 292 - val compare : t -> t -> int 293 end 294 295 module Page : sig 296 - type t = Paths_types.Identifier.page 297 - 298 - type t_pv = Paths_types.Identifier.page_pv 299 - 300 - val equal : t -> t -> bool 301 - 302 - val hash : t -> int 303 - 304 - val compare : t -> t -> int 305 end 306 307 module ContainerPage : sig 308 - type t = Paths_types.Identifier.container_page 309 - 310 - type t_pv = Paths_types.Identifier.container_page_pv 311 - 312 - val equal : t -> t -> bool 313 - 314 - val hash : t -> int 315 - 316 - val compare : t -> t -> int 317 - end 318 - 319 - module SourceDir : sig 320 - type t = Paths_types.Identifier.source_dir 321 - type t_pv = Paths_types.Identifier.source_dir_pv 322 - val equal : t -> t -> bool 323 - val hash : t -> int 324 - val compare : t -> t -> int 325 - val name : t -> string 326 end 327 328 module SourcePage : sig 329 - type t = Paths_types.Identifier.source_page 330 - type t_pv = Paths_types.Identifier.source_page_pv 331 val equal : t -> t -> bool 332 - val hash : t -> int 333 - val compare : t -> t -> int 334 - val name : t -> string 335 end 336 - 337 module OdocId : sig 338 - type t = Paths_types.Identifier.odoc_id 339 - 340 - type t_pv = Paths_types.Identifier.odoc_id_pv 341 - 342 - val equal : t -> t -> bool 343 - 344 - val hash : t -> int 345 - 346 - val compare : t -> t -> int 347 end 348 349 module Path : sig 350 - module Module : sig 351 - type t = Paths_types.Identifier.path_module 352 - 353 - type t_pv = Paths_types.Identifier.path_module_pv 354 - 355 - val equal : t -> t -> bool 356 - 357 - val hash : t -> int 358 - 359 - val compare : t -> t -> int 360 - 361 - val root : t -> RootModule.t 362 - end 363 - 364 - module ModuleType : sig 365 - type t = Paths_types.Identifier.path_module_type 366 - 367 - val equal : t -> t -> bool 368 - 369 - val hash : t -> int 370 - 371 - val compare : t -> t -> int 372 - end 373 - 374 - module Type : sig 375 - type t = Paths_types.Identifier.path_type 376 - 377 - type t_pv = Paths_types.Identifier.path_type_pv 378 379 - val equal : t -> t -> bool 380 381 - val hash : t -> int 382 383 - val compare : t -> t -> int 384 - end 385 386 - module ClassType : sig 387 - type t = Paths_types.Identifier.path_class_type 388 - 389 - type t_pv = Paths_types.Identifier.path_class_type_pv 390 - 391 - val equal : t -> t -> bool 392 - 393 - val hash : t -> int 394 - 395 - val compare : t -> t -> int 396 - end 397 - 398 - type t = Paths_types.Identifier.path_any 399 end 400 401 - type t_pv = Paths_types.Identifier.any_pv 402 403 - type t = Paths_types.Identifier.any 404 405 val hash : t -> int 406 407 val name : [< t_pv ] id -> string 408 409 - val root : [< t_pv ] id -> RootModule.t_pv id option 410 411 val compare : t -> t -> int 412 ··· 523 524 val is_hidden : t -> weak_canonical_test:bool -> bool 525 526 - val identifier : t -> Identifier.Path.Module.t 527 528 - val root : t -> string option 529 end 530 531 module ModuleType : sig 532 type t = Paths_types.Resolved_path.module_type 533 534 - val is_hidden : t -> weak_canonical_test:bool -> bool 535 536 (* val identifier : t -> Identifier.Path.ModuleType.t *) 537 end ··· 539 module Type : sig 540 type t = Paths_types.Resolved_path.type_ 541 542 - val of_ident : Identifier.Path.Type.t -> t 543 544 - val is_hidden : t -> bool 545 546 (* val identifier : t -> Identifier.Path.Type.t *) 547 end ··· 549 module ClassType : sig 550 type t = Paths_types.Resolved_path.class_type 551 552 - val of_ident : Identifier.Path.ClassType.t -> t 553 554 - val is_hidden : t -> bool 555 end 556 557 type t = Paths_types.Resolved_path.any ··· 564 module Module : sig 565 type t = Paths_types.Path.module_ 566 567 - val root : t -> string option 568 end 569 570 module ModuleType : sig ··· 589 module Resolved : sig 590 module Signature : sig 591 type t = Paths_types.Resolved_fragment.signature 592 - 593 - val split : t -> string * t option 594 end 595 596 module Module : sig 597 type t = Paths_types.Resolved_fragment.module_ 598 - 599 - val split : t -> string * t option 600 end 601 602 module ModuleType : sig 603 type t = Paths_types.Resolved_fragment.module_type 604 - 605 - val split : t -> string * t option 606 end 607 608 module Type : sig 609 type t = Paths_types.Resolved_fragment.type_ 610 - 611 - val split : t -> string * t option 612 end 613 614 type leaf = Paths_types.Resolved_fragment.leaf ··· 624 625 module Signature : sig 626 type t = Paths_types.Fragment.signature 627 - 628 - val split : t -> string * t option 629 end 630 631 module Module : sig 632 type t = Paths_types.Fragment.module_ 633 - 634 - val split : t -> string * t option 635 end 636 637 module ModuleType : sig 638 type t = Paths_types.Fragment.module_type 639 - 640 - val split : t -> string * t option 641 end 642 643 module Type : sig 644 type t = Paths_types.Fragment.type_ 645 - 646 - val split : t -> string * t option 647 end 648 649 type leaf = Paths_types.Fragment.leaf
··· 24 25 type 'a id = 'a Paths_types.id = { iv : 'a; ihash : int; ikey : string } 26 27 + module type IdSig = sig 28 + type t 29 + type t_pv 30 val equal : t -> t -> bool 31 val hash : t -> int 32 val compare : t -> t -> int 33 end 34 35 + module Id = Paths_types.Identifier 36 37 + module Any : IdSig with type t = Id.any and type t_pv = Id.any_pv 38 39 + module RootModule : 40 + IdSig with type t = Id.root_module and type t_pv = Id.root_module_pv 41 42 + module Signature : 43 + IdSig with type t = Id.signature and type t_pv = Id.signature_pv 44 45 + module ClassSignature : 46 + IdSig with type t = Id.class_signature and type t_pv = Id.class_signature_pv 47 48 + module LabelParent : 49 + IdSig with type t = Id.label_parent and type t_pv = Id.label_parent_pv 50 51 + module Module : IdSig with type t = Id.module_ and type t_pv = Id.module_pv 52 53 + module FunctorParameter : 54 + IdSig 55 + with type t = Id.functor_parameter 56 + and type t_pv = Id.functor_parameter_pv 57 58 + module ModuleType : 59 + IdSig with type t = Id.module_type and type t_pv = Id.module_type_pv 60 61 + module Type : IdSig with type t = Id.type_ and type t_pv = Id.type_pv 62 63 + module SourceDir : sig 64 65 + include IdSig with type t = Id.source_dir and type t_pv = Id.source_dir_pv 66 + val name : t -> string 67 end 68 69 + module Class : IdSig with type t = Id.class_ and type t_pv = Id.class_pv 70 71 + module ClassType : 72 + IdSig with type t = Id.class_type and type t_pv = Id.class_type_pv 73 74 module DataType : sig 75 + type t = Id.datatype 76 + type t_pv = Id.datatype_pv 77 end 78 module Parent : sig 79 + type t = Id.parent 80 + type t_pv = Id.parent_pv 81 end 82 83 module FunctorResult : sig 84 + type t = Id.functor_result 85 + type t_pv = Id.functor_result_pv 86 end 87 88 module Constructor : sig 89 + type t = Id.constructor 90 + type t_pv = Id.constructor_pv 91 end 92 93 module Field : sig 94 + type t = Id.field 95 + type t_pv = Id.field_pv 96 end 97 98 module Extension : sig 99 + type t = Id.extension 100 + type t_pv = Id.extension_pv 101 end 102 103 module Exception : sig 104 + type t = Id.exception_ 105 + type t_pv = Id.exception_pv 106 end 107 108 module Value : sig 109 + type t = Id.value 110 + type t_pv = Id.value_pv 111 end 112 113 module Method : sig 114 + type t = Id.method_ 115 + type t_pv = Id.method_pv 116 end 117 118 module InstanceVariable : sig 119 + type t = Id.instance_variable 120 + type t_pv = Id.instance_variable_pv 121 end 122 + module Label : 123 + IdSig 124 + with type t = Paths_types.Identifier.label 125 + and type t_pv = Paths_types.Identifier.label_pv 126 127 module Page : sig 128 + type t = Id.page 129 + type t_pv = Id.page_pv 130 end 131 132 module ContainerPage : sig 133 + type t = Id.container_page 134 + type t_pv = Id.container_page_pv 135 end 136 137 module SourcePage : sig 138 + type t = Id.source_page 139 + type t_pv = Id.source_page_pv 140 + val name : t -> string 141 val equal : t -> t -> bool 142 end 143 module OdocId : sig 144 + type t = Id.odoc_id 145 + type t_pv = Id.odoc_id_pv 146 end 147 148 module Path : sig 149 + module Module : 150 + IdSig with type t = Id.path_module and type t_pv = Id.path_module_pv 151 152 + module ModuleType : 153 + IdSig with type t = Id.path_module_type and type t_pv = Id.module_type_pv 154 155 + module Type : 156 + IdSig with type t = Id.path_type and type t_pv = Id.path_type_pv 157 158 + module ClassType : 159 + IdSig 160 + with type t = Id.path_class_type 161 + and type t_pv = Id.path_class_type_pv 162 163 + type t = Id.path_any 164 end 165 166 + type t = Id.any 167 168 + type t_pv = Id.any_pv 169 170 val hash : t -> int 171 172 val name : [< t_pv ] id -> string 173 174 + (* val root : [< t_pv ] id -> RootModule.t_pv id option *) 175 176 val compare : t -> t -> int 177 ··· 288 289 val is_hidden : t -> weak_canonical_test:bool -> bool 290 291 + (* val identifier : t -> Identifier.Path.Module.t *) 292 293 + (* val root : t -> string option *) 294 end 295 296 module ModuleType : sig 297 type t = Paths_types.Resolved_path.module_type 298 299 + (* val is_hidden : t -> weak_canonical_test:bool -> bool *) 300 301 (* val identifier : t -> Identifier.Path.ModuleType.t *) 302 end ··· 304 module Type : sig 305 type t = Paths_types.Resolved_path.type_ 306 307 + (* val of_ident : Identifier.Path.Type.t -> t *) 308 309 + (* val is_hidden : t -> bool *) 310 311 (* val identifier : t -> Identifier.Path.Type.t *) 312 end ··· 314 module ClassType : sig 315 type t = Paths_types.Resolved_path.class_type 316 317 + (* val of_ident : Identifier.Path.ClassType.t -> t *) 318 319 + (* val is_hidden : t -> bool *) 320 end 321 322 type t = Paths_types.Resolved_path.any ··· 329 module Module : sig 330 type t = Paths_types.Path.module_ 331 332 + (* val root : t -> string option *) 333 end 334 335 module ModuleType : sig ··· 354 module Resolved : sig 355 module Signature : sig 356 type t = Paths_types.Resolved_fragment.signature 357 end 358 359 module Module : sig 360 type t = Paths_types.Resolved_fragment.module_ 361 end 362 363 module ModuleType : sig 364 type t = Paths_types.Resolved_fragment.module_type 365 end 366 367 module Type : sig 368 type t = Paths_types.Resolved_fragment.type_ 369 end 370 371 type leaf = Paths_types.Resolved_fragment.leaf ··· 381 382 module Signature : sig 383 type t = Paths_types.Fragment.signature 384 end 385 386 module Module : sig 387 type t = Paths_types.Fragment.module_ 388 end 389 390 module ModuleType : sig 391 type t = Paths_types.Fragment.module_type 392 end 393 394 module Type : sig 395 type t = Paths_types.Fragment.type_ 396 end 397 398 type leaf = Paths_types.Fragment.leaf
+1 -3
src/odoc/compile.ml
··· 309 | { Paths.Identifier.iv = `Page _; _ } as parent_id -> 310 let name = Paths.Identifier.Mk.source_page (parent_id, name) in 311 if 312 - List.exists 313 - (Paths.Identifier.SourcePage.equal name) 314 - page.source_children 315 then Ok (Some name) 316 else err_not_parent () 317 | { iv = `LeafPage _; _ } -> err_not_parent ())
··· 309 | { Paths.Identifier.iv = `Page _; _ } as parent_id -> 310 let name = Paths.Identifier.Mk.source_page (parent_id, name) in 311 if 312 + List.exists (Paths.Identifier.SourcePage.equal name) page.source_children 313 then Ok (Some name) 314 else err_not_parent () 315 | { iv = `LeafPage _; _ } -> err_not_parent ())
+3 -5
src/xref2/cpath.ml
··· 219 220 and is_resolved_module_type_hidden : Resolved.module_type -> bool = function 221 | `Local _ -> false 222 - | `Gpath p -> 223 - Odoc_model.Paths.Path.Resolved.ModuleType.is_hidden 224 - ~weak_canonical_test:false p 225 | `Substituted p -> is_resolved_module_type_hidden p 226 | `ModuleType (p, _) -> is_resolved_parent_hidden ~weak_canonical_test:false p 227 | `SubstT (p1, p2) -> ··· 247 248 and is_resolved_type_hidden : Resolved.type_ -> bool = function 249 | `Local _ -> false 250 - | `Gpath p -> Odoc_model.Paths.Path.Resolved.Type.is_hidden p 251 | `Substituted p -> is_resolved_type_hidden p 252 | `CanonicalType (_, `Resolved _) -> false 253 | `CanonicalType (p, _) -> is_resolved_type_hidden p ··· 256 257 and is_resolved_class_type_hidden : Resolved.class_type -> bool = function 258 | `Local _ -> false 259 - | `Gpath p -> Odoc_model.Paths.Path.Resolved.ClassType.is_hidden p 260 | `Substituted p -> is_resolved_class_type_hidden p 261 | `Class (p, _) | `ClassType (p, _) -> 262 is_resolved_parent_hidden ~weak_canonical_test:false p
··· 219 220 and is_resolved_module_type_hidden : Resolved.module_type -> bool = function 221 | `Local _ -> false 222 + | `Gpath p -> Odoc_model.Paths.Path.Resolved.(is_hidden (p :> t)) 223 | `Substituted p -> is_resolved_module_type_hidden p 224 | `ModuleType (p, _) -> is_resolved_parent_hidden ~weak_canonical_test:false p 225 | `SubstT (p1, p2) -> ··· 245 246 and is_resolved_type_hidden : Resolved.type_ -> bool = function 247 | `Local _ -> false 248 + | `Gpath p -> Odoc_model.Paths.Path.Resolved.(is_hidden (p :> t)) 249 | `Substituted p -> is_resolved_type_hidden p 250 | `CanonicalType (_, `Resolved _) -> false 251 | `CanonicalType (p, _) -> is_resolved_type_hidden p ··· 254 255 and is_resolved_class_type_hidden : Resolved.class_type -> bool = function 256 | `Local _ -> false 257 + | `Gpath p -> Odoc_model.Paths.Path.Resolved.(is_hidden (p :> t)) 258 | `Substituted p -> is_resolved_class_type_hidden p 259 | `Class (p, _) | `ClassType (p, _) -> 260 is_resolved_parent_hidden ~weak_canonical_test:false p
+1 -1
src/xref2/link.ml
··· 847 let hidden_path = 848 match equation.Equation.manifest with 849 | Some (Constr (`Resolved path, params)) 850 - when Paths.Path.Resolved.Type.is_hidden path 851 || Paths.Path.Resolved.(identifier (path :> t)) 852 = (t.id :> Paths.Identifier.t) -> 853 Some (path, params)
··· 847 let hidden_path = 848 match equation.Equation.manifest with 849 | Some (Constr (`Resolved path, params)) 850 + when Paths.Path.Resolved.(is_hidden (path :> t)) 851 || Paths.Path.Resolved.(identifier (path :> t)) 852 = (t.id :> Paths.Identifier.t) -> 853 Some (path, params)