• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ocaml / odoc / 3053

19 Feb 2026 10:47AM UTC coverage: 71.712% (-1.2%) from 72.946%
3053

Pull #1399

github

web-flow
Merge bf200aeef into c3f0f46ee
Pull Request #1399: Upstream OxCaml

20 of 280 new or added lines in 21 files covered. (7.14%)

162 existing lines in 11 files now uncovered.

10399 of 14501 relevant lines covered (71.71%)

7008.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.89
/src/model/paths.ml
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

17
module Ocaml_ident = Ident
18
module Ocaml_env = Env
19

20
open Names
21

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 ->
33
    match x.iv with
322,030✔
34
    | `Root (_, name) -> ModuleName.to_string name
49,043✔
35
    | `Page (_, name) -> PageName.to_string name
31✔
36
    | `LeafPage (_, name) -> PageName.to_string name
58✔
37
    | `Module (_, name) -> ModuleName.to_string name
63,920✔
38
    | `Parameter (_, name) -> ModuleName.to_string name
2,148✔
39
    | `Result x -> name_aux (x :> t)
×
40
    | `ModuleType (_, name) -> ModuleTypeName.to_string name
35,765✔
41
    | `Type (_, name) -> TypeName.to_string name
165,843✔
42
    | `Constructor (_, name) -> ConstructorName.to_string name
998✔
43
    | `Field (_, name) -> FieldName.to_string name
226✔
NEW
44
    | `UnboxedField (_, name) -> UnboxedFieldName.to_string name
×
45
    | `Extension (_, name) -> ExtensionName.to_string name
469✔
46
    | `ExtensionDecl (_, _, name) -> ExtensionName.to_string name
2✔
47
    | `Exception (_, name) -> ExceptionName.to_string name
111✔
48
    | `Value (_, name) -> ValueName.to_string name
2,188✔
49
    | `Class (_, name) -> TypeName.to_string name
264✔
50
    | `ClassType (_, name) -> TypeName.to_string name
142✔
51
    | `Method (_, name) -> MethodName.to_string name
90✔
52
    | `InstanceVariable (_, name) -> InstanceVariableName.to_string name
17✔
53
    | `Label (_, name) -> LabelName.to_string name
707✔
54
    | `SourcePage (_, name) -> name
2✔
55
    | `SourceLocation (x, anchor) ->
×
56
        name_aux (x :> t) ^ "#" ^ DefName.to_string anchor
×
57
    | `SourceLocationMod x -> name_aux (x :> t)
×
58
    | `SourceLocationInternal (x, anchor) ->
×
59
        name_aux (x :> t) ^ "#" ^ LocalName.to_string anchor
×
60
    | `AssetFile (_, name) -> AssetName.to_string name
6✔
61

62
  let rec is_hidden : t -> bool =
63
   fun x ->
64
    match x.iv with
149,581✔
65
    | `Root (_, name) -> ModuleName.is_hidden name
2,189✔
66
    | `Page (_, _) -> false
×
67
    | `LeafPage (_, _) -> false
×
68
    | `Module (_, name) -> ModuleName.is_hidden name
3,624✔
69
    | `Parameter (_, name) -> ModuleName.is_hidden name
69✔
70
    | `Result x -> is_hidden (x :> t)
67✔
71
    | `ModuleType (_, name) -> ModuleTypeName.is_hidden name
1,025✔
72
    | `Type (_, name) -> TypeName.is_hidden name
26,012✔
73
    | `Constructor (parent, _) -> is_hidden (parent :> t)
239✔
74
    | `Field (parent, _) -> is_hidden (parent :> t)
2✔
NEW
75
    | `UnboxedField (parent, _) -> is_hidden (parent :> t)
×
76
    | `Extension (parent, _) -> is_hidden (parent :> t)
34✔
77
    | `ExtensionDecl (parent, _, _) -> is_hidden (parent :> t)
×
78
    | `Exception (parent, _) -> is_hidden (parent :> t)
35✔
79
    | `Value (_, name) -> ValueName.is_hidden name
116,238✔
80
    | `Class (_, name) -> TypeName.is_hidden name
31✔
81
    | `ClassType (_, name) -> TypeName.is_hidden name
14✔
82
    | `Method (parent, _) -> is_hidden (parent :> t)
2✔
83
    | `InstanceVariable (parent, _) -> is_hidden (parent :> t)
×
84
    | `Label (parent, _) -> is_hidden (parent :> t)
×
85
    | `SourceLocationMod _ | `SourceLocation _ | `SourcePage _
×
86
    | `SourceLocationInternal _ | `AssetFile _ ->
×
87
        false
88

89
  let name : [< t_pv ] id -> string = fun n -> name_aux (n :> t)
322,030✔
90

91
  let rec full_name_aux : t -> string list =
92
   fun x ->
93
    match x.iv with
240,374✔
94
    | `Root (_, name) -> [ ModuleName.to_string name ]
64,060✔
95
    | `Page (None, name) -> [ PageName.to_string name ]
29✔
96
    | `Page (Some parent, name) ->
6✔
97
        PageName.to_string name :: full_name_aux (parent :> t)
6✔
98
    | `LeafPage (None, name) -> [ PageName.to_string name ]
2✔
99
    | `LeafPage (Some parent, name) ->
×
100
        PageName.to_string name :: full_name_aux (parent :> t)
×
101
    | `Module (parent, name) ->
39,259✔
102
        ModuleName.to_string name :: full_name_aux (parent :> t)
39,259✔
103
    | `Parameter (parent, name) ->
×
104
        ModuleName.to_string name :: full_name_aux (parent :> t)
×
105
    | `Result x -> full_name_aux (x :> t)
41,779✔
106
    | `ModuleType (parent, name) ->
32,176✔
107
        ModuleTypeName.to_string name :: full_name_aux (parent :> t)
32,176✔
108
    | `Type (parent, name) ->
11,876✔
109
        TypeName.to_string name :: full_name_aux (parent :> t)
11,876✔
110
    | `Constructor (parent, name) ->
243✔
111
        ConstructorName.to_string name :: full_name_aux (parent :> t)
243✔
112
    | `Field (parent, name) ->
2✔
113
        FieldName.to_string name :: full_name_aux (parent :> t)
2✔
NEW
114
    | `UnboxedField (parent, name) ->
×
NEW
115
        UnboxedFieldName.to_string name :: full_name_aux (parent :> t)
×
116
    | `Extension (parent, name) ->
3✔
117
        ExtensionName.to_string name :: full_name_aux (parent :> t)
3✔
118
    | `ExtensionDecl (parent, _, name) ->
×
119
        ExtensionName.to_string name :: full_name_aux (parent :> t)
×
120
    | `Exception (parent, name) ->
11✔
121
        ExceptionName.to_string name :: full_name_aux (parent :> t)
11✔
122
    | `Value (parent, name) ->
50,895✔
123
        ValueName.to_string name :: full_name_aux (parent :> t)
50,895✔
124
    | `Class (parent, name) ->
3✔
125
        TypeName.to_string name :: full_name_aux (parent :> t)
3✔
126
    | `ClassType (parent, name) ->
1✔
127
        TypeName.to_string name :: full_name_aux (parent :> t)
1✔
128
    | `Method (parent, name) ->
2✔
129
        MethodName.to_string name :: full_name_aux (parent :> t)
2✔
130
    | `InstanceVariable (parent, name) ->
×
131
        InstanceVariableName.to_string name :: full_name_aux (parent :> t)
×
132
    | `Label (parent, name) ->
×
133
        LabelName.to_string name :: full_name_aux (parent :> t)
×
134
    | `SourceLocation (parent, name) ->
×
135
        DefName.to_string name :: full_name_aux (parent :> t)
×
136
    | `SourceLocationInternal (parent, name) ->
×
137
        LocalName.to_string name :: full_name_aux (parent :> t)
×
138
    | `SourceLocationMod name -> full_name_aux (name :> t)
×
139
    | `SourcePage (parent, name) -> name :: full_name_aux (parent :> t)
27✔
140
    | `AssetFile (parent, name) ->
×
141
        AssetName.to_string name :: full_name_aux (parent :> t)
×
142

143
  let fullname : [< t_pv ] id -> string list =
144
   fun n -> List.rev @@ full_name_aux (n :> t)
64,091✔
145

146
  let is_hidden : [< t_pv ] id -> bool = fun n -> is_hidden (n :> t)
149,202✔
147

148
  let rec label_parent_aux =
149
    let open Id in
150
    fun (n : non_src) ->
151
      match n with
126,662✔
152
      | { iv = `Result i; _ } -> label_parent_aux (i :> non_src)
31,114✔
153
      | { iv = `Root _; _ } as p -> (p :> label_parent)
1✔
154
      | { iv = `Page _; _ } as p -> (p :> label_parent)
×
155
      | { iv = `LeafPage _; _ } as p -> (p :> label_parent)
×
156
      | { iv = `Module (p, _); _ }
32,803✔
157
      | { iv = `ModuleType (p, _); _ }
1✔
158
      | { iv = `Parameter (p, _); _ }
×
159
      | { iv = `Class (p, _); _ }
4✔
160
      | { iv = `ClassType (p, _); _ }
2✔
161
      | { iv = `Type (p, _); _ }
11,623✔
162
      | { iv = `Extension (p, _); _ }
3✔
163
      | { iv = `ExtensionDecl (p, _, _); _ }
×
164
      | { iv = `Exception (p, _); _ }
12✔
165
      | { iv = `Value (p, _); _ } ->
50,856✔
166
          (p : signature :> label_parent)
167
      | { iv = `Label (p, _); _ } -> p
×
168
      | { iv = `Method (p, _); _ } | { iv = `InstanceVariable (p, _); _ } ->
×
169
          (p : class_signature :> label_parent)
170
      | { iv = `Constructor (p, _); _ } -> (p : datatype :> label_parent)
239✔
171
      | { iv = `Field (p, _); _ } -> (p : field_parent :> label_parent)
2✔
NEW
172
      | { iv = `UnboxedField (p, _); _ } -> (p : unboxed_field_parent :> label_parent)
×
173

174
  let label_parent n = label_parent_aux (n :> Id.non_src)
95,548✔
175

176
  let equal x y = x.ihash = y.ihash && x.ikey = y.ikey
317✔
177

178
  let hash x = x.ihash
492✔
179

180
  let compare x y = compare x.ikey y.ikey
1,986,191✔
181

182
  type any = t
183

184
  type any_pv = t_pv
185

186
  module type IdSig = sig
187
    type t
188
    type t_pv
189
    val equal : t -> t -> bool
190
    val hash : t -> int
191
    val compare : t -> t -> int
192
  end
193

194
  module Any = struct
195
    type t = any
196
    type t_pv = any_pv
197
    let equal = equal
198
    let hash = hash
199
    let compare = compare
200
  end
201

202
  module Signature = struct
203
    type t = Id.signature
204
    type t_pv = Id.signature_pv
205
    let equal = equal
206
    let hash = hash
207
    let compare = compare
208
  end
209

210
  module ClassSignature = struct
211
    type t = Id.class_signature
212
    type t_pv = Id.class_signature_pv
213
    let equal = equal
214
    let hash = hash
215
    let compare = compare
216
  end
217

218
  module DataType = struct
219
    type t = Id.datatype
220
    type t_pv = Id.datatype_pv
221
  end
222

223
  module FieldParent = struct
224
    type t = Paths_types.Identifier.field_parent
225
    type t_pv = Paths_types.Identifier.field_parent_pv
226
  end
227

228
  module UnboxedFieldParent = struct
229
    type t = Paths_types.Identifier.unboxed_field_parent
230
    type t_pv = Paths_types.Identifier.unboxed_field_parent_pv
231
  end
232

233
  module LabelParent = struct
234
    type t = Id.label_parent
235
    type t_pv = Id.label_parent_pv
236
    let equal = equal
237
    let hash = hash
238
    let compare = compare
239
  end
240

241
  module RootModule = struct
242
    type t = Id.root_module
243
    type t_pv = Id.root_module_pv
244
    let equal = equal
245
    let hash = hash
246
    let compare = compare
247
  end
248

249
  module Module = struct
250
    type t = Id.module_
251
    type t_pv = Id.module_pv
252
    let equal = equal
253
    let hash = hash
254
    let compare = compare
255
  end
256

257
  module FunctorParameter = struct
258
    type t = Id.functor_parameter
259
    type t_pv = Id.functor_parameter_pv
260
    let equal = equal
261
    let hash = hash
262
    let compare = compare
263

264
    let functor_arg_pos { iv = `Parameter (p, _); _ } =
265
      let rec inner_sig = function
3,926✔
266
        | `Result { iv = p; _ } -> 1 + inner_sig p
369✔
267
        | `Module _ | `ModuleType _ | `Root _ | `Parameter _ -> 1
×
268
      in
269
      inner_sig p.iv
270
  end
271

272
  module FunctorResult = struct
273
    type t = Id.functor_result
274
    type t_pv = Id.functor_result_pv
275
  end
276

277
  module ModuleType = struct
278
    type t = Id.module_type
279
    type t_pv = Id.module_type_pv
280
    let equal = equal
281
    let hash = hash
282
    let compare = compare
283
  end
284

285
  module Type = struct
286
    type t = Id.type_
287
    type t_pv = Id.type_pv
288
    let equal = equal
289
    let hash = hash
290
    let compare = compare
291
  end
292

293
  module Constructor = struct
294
    type t = Id.constructor
295
    type t_pv = Id.constructor_pv
296
  end
297

298
  module Field = struct
299
    type t = Id.field
300
    type t_pv = Id.field_pv
301
  end
302

303
  module UnboxedField = struct
304
    type t = Id.unboxed_field
305
    type t_pv = Id.unboxed_field_pv
306
  end
307

308
  module Extension = struct
309
    type t = Id.extension
310
    type t_pv = Id.extension_pv
311
  end
312

313
  module ExtensionDecl = struct
314
    type t = Paths_types.Identifier.extension_decl
315

316
    type t_pv = Paths_types.Identifier.extension_decl_pv
317

318
    let equal = equal
319

320
    let hash = hash
321

322
    let compare = compare
323
  end
324

325
  module Exception = struct
326
    type t = Id.exception_
327
    type t_pv = Id.exception_pv
328
  end
329

330
  module Value = struct
331
    type t = Id.value
332
    type t_pv = Id.value_pv
333
  end
334

335
  module Class = struct
336
    type t = Id.class_
337
    type t_pv = Id.class_pv
338
    let equal = equal
339
    let hash = hash
340
    let compare = compare
341
  end
342

343
  module ClassType = struct
344
    type t = Id.class_type
345
    type t_pv = Id.class_type_pv
346
    let equal = equal
347
    let hash = hash
348
    let compare = compare
349
  end
350

351
  module Method = struct
352
    type t = Id.method_
353
    type t_pv = Id.method_pv
354
  end
355

356
  module InstanceVariable = struct
357
    type t = Id.instance_variable
358
    type t_pv = Id.instance_variable_pv
359
  end
360

361
  module Label = struct
362
    type t = Paths_types.Identifier.label
363
    type t_pv = Paths_types.Identifier.label_pv
364
    let equal = equal
365
    let hash = hash
366
    let compare = compare
367
  end
368

369
  module Page = struct
370
    type t = Id.page
371
    type t_pv = Id.page_pv
372
  end
373

374
  module LeafPage = struct
375
    type t = Id.leaf_page
376
    type t_pv = Id.leaf_page_pv
377
    let equal = equal
378
    let hash = hash
379
  end
380

381
  module ContainerPage = struct
382
    type t = Id.container_page
383
    type t_pv = Id.container_page_pv
384
    let equal = equal
385
    let hash = hash
386
  end
387

388
  module NonSrc = struct
389
    type t = Paths_types.Identifier.non_src
390
    type t_pv = Paths_types.Identifier.non_src_pv
391

392
    let equal x y = x.ihash = y.ihash && x.ikey = y.ikey
×
393

394
    let hash x = x.ihash
×
395
  end
396

397
  module SourcePage = struct
398
    type t = Id.source_page
399
    type t_pv = Id.source_page_pv
400

401
    let equal = equal
402
    let hash = hash
403
  end
404

405
  module SourceLocation = struct
406
    type t = Paths_types.Identifier.source_location
407
    type t_pv = Paths_types.Identifier.source_location_pv
408
  end
409

410
  module AssetFile = struct
411
    type t = Id.asset_file
412
    type t_pv = Id.asset_file_pv
413
  end
414

415
  module OdocId = struct
416
    type t = Id.odoc_id
417
    type t_pv = Id.odoc_id_pv
418
  end
419

420
  module Path = struct
421
    module Module = struct
422
      type t = Id.path_module
423
      type t_pv = Id.path_module_pv
424
      let equal = equal
425
      let hash = hash
426
      let compare = compare
427
    end
428

429
    module ModuleType = struct
430
      type t = Id.path_module_type
431
      type t_pv = Id.module_type_pv
432
      let equal = equal
433
      let hash = hash
434
      let compare = compare
435
    end
436

437
    module Type = struct
438
      type t = Id.path_type
439
      type t_pv = Id.path_type_pv
440
      let equal = equal
441
      let hash = hash
442
      let compare = compare
443
    end
444

445
    module Value = struct
446
      type t = Id.path_value
447
      type t_pv = Id.value_pv
448
      let equal = equal
449
      let hash = hash
450
      let compare = compare
451
    end
452

453
    module ClassType = struct
454
      type t = Id.path_class_type
455
      type t_pv = Id.path_class_type_pv
456
      let equal = equal
457
      let hash = hash
458
      let compare = compare
459
    end
460

461
    type t = Id.path_any
462
  end
463

464
  module Maps = struct
465
    module Any = Map.Make (Any)
466
    module FunctorParameter = Map.Make (FunctorParameter)
467
    module Module = Map.Make (Module)
468
    module ModuleType = Map.Make (ModuleType)
469
    module Type = Map.Make (Type)
470
    module Class = Map.Make (Class)
471
    module ClassType = Map.Make (ClassType)
472
    module Label = Map.Make (Label)
473

474
    module Path = struct
475
      module Module = Map.Make (Path.Module)
476
      module ModuleType = Map.Make (Path.ModuleType)
477
      module Type = Map.Make (Path.Type)
478
      module ClassType = Map.Make (Path.ClassType)
479
    end
480
  end
481

482
  module Mk = struct
483
    let mk_fresh to_str ty f x =
484
      let ikey = Printf.sprintf "%s_%s" ty (to_str x) in
33✔
485
      let ihash = Hashtbl.hash ikey in
33✔
486
      { iv = f x; ihash; ikey }
33✔
487

488
    let mk_parent to_str ty f (parent, x) =
489
      let ikey = Printf.sprintf "%s_%s.%s" ty (to_str x) parent.ikey in
94,407✔
490
      let ihash = Hashtbl.hash ikey in
94,407✔
491

492
      { iv = f (parent, x); ihash; ikey }
94,407✔
493

494
    let mk_parent_opt to_str ty f (parent_opt, x) =
495
      let ikey =
1,390✔
496
        match parent_opt with
497
        | None -> Printf.sprintf "%s_%s" ty (to_str x)
1,043✔
498
        | Some p -> Printf.sprintf "%s_%s.%s" ty (to_str x) p.ikey
347✔
499
      in
500
      let ihash = Hashtbl.hash ikey in
501
      { iv = f (parent_opt, x); ihash; ikey }
1,390✔
502

503
    let page :
504
        ContainerPage.t option * PageName.t ->
505
        [> `Page of ContainerPage.t option * PageName.t ] id =
506
      mk_parent_opt PageName.to_string "p" (fun (p, n) -> `Page (p, n))
723✔
507

508
    let leaf_page :
509
        ContainerPage.t option * PageName.t ->
510
        [> `LeafPage of ContainerPage.t option * PageName.t ] id =
511
      mk_parent_opt PageName.to_string "lp" (fun (p, n) -> `LeafPage (p, n))
145✔
512

513
    let asset_file : Page.t * AssetName.t -> AssetFile.t =
514
      mk_parent AssetName.to_string "asset" (fun (p, n) -> `AssetFile (p, n))
6✔
515

516
    let source_page (container_page, name) =
517
      mk_parent
27✔
518
        (fun x -> x)
27✔
519
        "sp"
520
        (fun (p, rp) -> `SourcePage (p, rp))
27✔
521
        (container_page, name)
522

523
    let root :
524
        ContainerPage.t option * ModuleName.t ->
525
        [> `Root of ContainerPage.t option * ModuleName.t ] id =
526
      mk_parent_opt ModuleName.to_string "r" (fun (p, n) -> `Root (p, n))
522✔
527

528
    let implementation =
529
      mk_fresh
1,439✔
530
        (fun s -> s)
33✔
531
        "impl"
532
        (fun s -> `Implementation (ModuleName.make_std s))
33✔
533

534
    let module_ :
535
        Signature.t * ModuleName.t ->
536
        [> `Module of Signature.t * ModuleName.t ] id =
537
      mk_parent ModuleName.to_string "m" (fun (p, n) -> `Module (p, n))
1,439✔
538

539
    let parameter :
540
        Signature.t * ModuleName.t ->
541
        [> `Parameter of Signature.t * ModuleName.t ] id =
542
      mk_parent ModuleName.to_string "p" (fun (p, n) -> `Parameter (p, n))
71✔
543

544
    let result : Signature.t -> [> `Result of Signature.t ] id =
545
     fun s ->
546
      mk_parent (fun () -> "__result__") "" (fun (s, ()) -> `Result s) (s, ())
180✔
547

548
    let module_type :
549
        Signature.t * ModuleTypeName.t ->
550
        [> `ModuleType of Signature.t * ModuleTypeName.t ] id =
551
      mk_parent ModuleTypeName.to_string "mt" (fun (p, n) -> `ModuleType (p, n))
1,125✔
552

553
    let class_ :
554
        Signature.t * TypeName.t -> [> `Class of Signature.t * TypeName.t ] id =
555
      mk_parent TypeName.to_string "c" (fun (p, n) -> `Class (p, n))
52✔
556

557
    let class_type :
558
        Signature.t * TypeName.t ->
559
        [> `ClassType of Signature.t * TypeName.t ] id =
560
      mk_parent TypeName.to_string "ct" (fun (p, n) -> `ClassType (p, n))
22✔
561

562
    let type_ :
563
        Signature.t * TypeName.t -> [> `Type of Signature.t * TypeName.t ] id =
564
      mk_parent TypeName.to_string "t" (fun (p, n) -> `Type (p, n))
1,439✔
565

566
    let core_type =
567
      mk_fresh (fun s -> s) "coret" (fun s -> `CoreType (TypeName.make_std s))
×
568

569
    let constructor :
570
        DataType.t * ConstructorName.t ->
571
        [> `Constructor of DataType.t * ConstructorName.t ] id =
572
      mk_parent ConstructorName.to_string "ctor" (fun (p, n) ->
1,439✔
573
          `Constructor (p, n))
209✔
574

575
    let field :
576
        FieldParent.t * FieldName.t ->
577
        [> `Field of FieldParent.t * FieldName.t ] id =
578
      mk_parent FieldName.to_string "fld" (fun (p, n) -> `Field (p, n))
46✔
579

580
    let unboxed_field :
581
        UnboxedFieldParent.t * UnboxedFieldName.t ->
582
        [> `UnboxedField of UnboxedFieldParent.t * UnboxedFieldName.t ] id =
NEW
583
      mk_parent UnboxedFieldName.to_string "unboxedfld" (fun (p, n) -> `UnboxedField (p, n))
×
584

585
    let extension :
586
        Signature.t * ExtensionName.t ->
587
        [> `Extension of Signature.t * ExtensionName.t ] id =
588
      mk_parent ExtensionName.to_string "extn" (fun (p, n) -> `Extension (p, n))
42✔
589

590
    let extension_decl :
591
        Signature.t * (ExtensionName.t * ExtensionName.t) ->
592
        [> `ExtensionDecl of Signature.t * ExtensionName.t * ExtensionName.t ]
593
        id =
594
      mk_parent
1,439✔
595
        (fun (n, m) ->
596
          ExtensionName.to_string n ^ "." ^ ExtensionName.to_string m)
4✔
597
        "extn-decl"
598
        (fun (p, (n, m)) -> `ExtensionDecl (p, n, m))
4✔
599

600
    let exception_ :
601
        Signature.t * ExceptionName.t ->
602
        [> `Exception of Signature.t * ExceptionName.t ] id =
603
      mk_parent ExceptionName.to_string "exn" (fun (p, n) -> `Exception (p, n))
143✔
604

605
    let value :
606
        Signature.t * ValueName.t -> [> `Value of Signature.t * ValueName.t ] id
607
        =
608
      mk_parent ValueName.to_string "v" (fun (p, n) -> `Value (p, n))
584✔
609

610
    let method_ :
611
        ClassSignature.t * MethodName.t ->
612
        [> `Method of ClassSignature.t * MethodName.t ] id =
613
      mk_parent MethodName.to_string "m" (fun (p, n) -> `Method (p, n))
42✔
614

615
    let instance_variable :
616
        ClassSignature.t * InstanceVariableName.t ->
617
        [> `InstanceVariable of ClassSignature.t * InstanceVariableName.t ] id =
618
      mk_parent InstanceVariableName.to_string "iv" (fun (p, n) ->
1,439✔
619
          `InstanceVariable (p, n))
6✔
620

621
    let label :
622
        LabelParent.t * LabelName.t ->
623
        [> `Label of LabelParent.t * LabelName.t ] id =
624
      mk_parent LabelName.to_string "l" (fun (p, n) -> `Label (p, n))
418✔
625

626
    let source_location :
627
        SourcePage.t * DefName.t ->
628
        [> `SourceLocation of SourcePage.t * DefName.t ] id =
629
      mk_parent DefName.to_string "sl" (fun (p, n) -> `SourceLocation (p, n))
107✔
630

631
    let source_location_mod :
632
        SourcePage.t -> [> `SourceLocationMod of SourcePage.t ] id =
633
     fun s ->
634
      mk_parent
35✔
635
        (fun () -> "__slm__")
35✔
636
        ""
637
        (fun (s, ()) -> `SourceLocationMod s)
35✔
638
        (s, ())
639

640
    let source_location_int :
641
        SourcePage.t * LocalName.t ->
642
        [> `SourceLocationInternal of SourcePage.t * LocalName.t ] id =
643
      mk_parent LocalName.to_string "sli" (fun (p, n) ->
1,439✔
644
          `SourceLocationInternal (p, n))
4✔
645
  end
646

647
  module Hashtbl = struct
648
    module Any = Hashtbl.Make (Any)
649
    module ContainerPage = Hashtbl.Make (ContainerPage)
650
    module LeafPage = Hashtbl.Make (LeafPage)
651
    module RootModule = Hashtbl.Make (RootModule)
652
    module SourcePage = Hashtbl.Make (SourcePage)
653
  end
654
end
655

656
module Path = struct
657
  type t = Paths_types.Path.any
658

659
  let rec is_resolved_hidden :
660
      weak_canonical_test:bool -> Paths_types.Resolved_path.any -> bool =
661
   fun ~weak_canonical_test x ->
662
    let open Paths_types.Resolved_path in
205,870✔
663
    let rec inner : Paths_types.Resolved_path.any -> bool = function
664
      | `Identifier { iv = `ModuleType (_, m); _ }
2,401✔
665
        when Names.ModuleTypeName.is_hidden m ->
2,401✔
666
          true
×
667
      | `Identifier { iv = `Type (_, t); _ } when Names.TypeName.is_hidden t ->
95,176✔
668
          true
21✔
669
      | `Identifier { iv = `Module (_, m); _ } when Names.ModuleName.is_hidden m
31,602✔
670
        ->
671
          true
2✔
672
      | `Identifier _ -> false
180,071✔
673
      | `Canonical (_, `Resolved _) -> false
716✔
674
      | `Canonical (x, _) ->
1✔
675
          (not weak_canonical_test) && inner (x : module_ :> any)
1✔
676
      | `Hidden _ -> true
70✔
677
      | `Subst (p1, p2) ->
48✔
678
          inner (p1 : module_type :> any) || inner (p2 : module_ :> any)
×
679
      | `Module (p, _) -> inner (p : module_ :> any)
3,228✔
680
      | `Apply (p, _) -> inner (p : module_ :> any)
96✔
681
      | `ModuleType (_, m) when Names.ModuleTypeName.is_hidden m -> true
×
682
      | `ModuleType (p, _) -> inner (p : module_ :> any)
810✔
683
      | `Type (_, t) when Names.TypeName.is_hidden t -> true
×
684
      | `CoreType t -> Names.TypeName.is_hidden t
25,052✔
685
      | `Type (p, _) -> inner (p : module_ :> any)
59,852✔
686
      | `Value (_, t) when Names.ValueName.is_hidden t -> true
×
687
      | `Value (p, _) -> inner (p : module_ :> any)
11✔
688
      | `Class (p, _) -> inner (p : module_ :> any)
20✔
689
      | `ClassType (p, _) -> inner (p : module_ :> any)
×
690
      | `Alias (dest, `Resolved src) ->
×
691
          inner (dest : module_ :> any) && inner (src : module_ :> any)
×
692
      | `Alias (dest, src) ->
21,230✔
693
          inner (dest : module_ :> any)
21,230✔
694
          && is_path_hidden (src :> Paths_types.Path.any)
×
695
      | `AliasModuleType (p1, p2) ->
326✔
696
          inner (p1 : module_type :> any) && inner (p2 : module_type :> any)
×
697
      | `SubstT (p1, p2) -> inner (p1 :> any) || inner (p2 :> any)
×
698
      | `Substituted m -> inner (m :> any)
41,334✔
699
      | `SubstitutedMT m -> inner (m :> any)
×
700
      | `SubstitutedT m -> inner (m :> any)
×
701
      | `SubstitutedCT m -> inner (m :> any)
×
702
      | `CanonicalModuleType (_, `Resolved _) -> false
4✔
703
      | `CanonicalModuleType (x, _) -> inner (x : module_type :> any)
×
704
      | `CanonicalType (_, `Resolved _) -> false
14✔
705
      | `CanonicalType (x, _) -> inner (x : type_ :> any)
×
706
      | `OpaqueModule m -> inner (m :> any)
17✔
707
      | `OpaqueModuleType mt -> inner (mt :> any)
543✔
708
    in
709
    inner x
710

711
  and is_path_hidden : Paths_types.Path.any -> bool =
712
    let open Paths_types.Path in
713
    function
714
    | `Resolved r -> is_resolved_hidden ~weak_canonical_test:false r
183,292✔
715
    | `Identifier (_, hidden) -> hidden
1,024✔
716
    | `Substituted r -> is_path_hidden (r :> any)
×
717
    | `SubstitutedMT r -> is_path_hidden (r :> any)
×
718
    | `SubstitutedT r -> is_path_hidden (r :> any)
×
719
    | `SubstitutedCT r -> is_path_hidden (r :> any)
×
720
    | `Root s -> ModuleName.is_hidden s
10✔
721
    | `Forward _ -> false
×
722
    | `Dot (p, n) ->
629✔
723
        ModuleName.is_hidden n || is_path_hidden (p : module_ :> any)
×
724
    | `DotMT (p, n) ->
×
725
        ModuleTypeName.is_hidden n || is_path_hidden (p : module_ :> any)
×
726
    | `DotT (p, n) ->
1✔
727
        TypeName.is_hidden n || is_path_hidden (p : module_ :> any)
×
728
    | `DotV (p, n) ->
×
729
        ValueName.is_hidden n || is_path_hidden (p : module_ :> any)
×
730
    | `Apply (p1, p2) ->
17✔
731
        is_path_hidden (p1 : module_ :> any)
×
732
        || is_path_hidden (p2 : module_ :> any)
733

734
  module Resolved = struct
735
    type t = Paths_types.Resolved_path.any
736

737
    let rec parent_module_type_identifier :
738
        Paths_types.Resolved_path.module_type -> Identifier.ModuleType.t option
739
        = function
740
      | `Identifier id -> Some (id : Identifier.ModuleType.t)
211✔
741
      | `ModuleType (m, n) -> (
92✔
742
          match parent_module_identifier m with
743
          | None -> None
×
744
          | Some p -> Some (Identifier.Mk.module_type (p, n)))
92✔
745
      | `SubstT (m, _n) -> parent_module_type_identifier m
×
746
      | `CanonicalModuleType (_, `Resolved p) -> parent_module_type_identifier p
×
747
      | `CanonicalModuleType (p, _) -> parent_module_type_identifier p
×
748
      | `OpaqueModuleType mt -> parent_module_type_identifier mt
×
749
      | `SubstitutedMT m -> parent_module_type_identifier m
×
750
      | `AliasModuleType (sub, orig) ->
41✔
751
          if is_resolved_hidden ~weak_canonical_test:false (sub :> t) then
752
            parent_module_type_identifier orig
×
753
          else parent_module_type_identifier sub
41✔
754

755
    and parent_module_identifier :
756
        Paths_types.Resolved_path.module_ -> Identifier.Signature.t option =
757
      function
758
      | `Identifier id ->
82,967✔
759
          Some (id : Identifier.Path.Module.t :> Identifier.Signature.t)
760
      | `Subst (sub, _) ->
44✔
761
          (parent_module_type_identifier sub :> Identifier.Signature.t option)
762
      | `Hidden _ -> None
14✔
763
      | `Module (m, n) -> (
5,270✔
764
          match parent_module_identifier m with
765
          | None -> None
4✔
766
          | Some p -> Some (Identifier.Mk.module_ (p, n)))
5,266✔
767
      | `Canonical (_, `Resolved p) -> parent_module_identifier p
210✔
768
      | `Canonical (p, _) -> parent_module_identifier p
4✔
769
      | `Apply (m, _) -> parent_module_identifier m
8✔
770
      | `Alias (dest, `Resolved src) ->
×
771
          if is_resolved_hidden ~weak_canonical_test:false (dest :> t) then
772
            parent_module_identifier src
×
773
          else parent_module_identifier dest
×
774
      | `Alias (dest, _src) -> parent_module_identifier dest
1,544✔
775
      | `Substituted m -> parent_module_identifier m
79,444✔
776
      | `OpaqueModule m -> parent_module_identifier m
×
777

778
    module Module = struct
779
      type t = Paths_types.Resolved_path.module_
780

781
      let is_hidden m =
782
        is_resolved_hidden (m : t :> Paths_types.Resolved_path.any)
21,136✔
783
    end
784

785
    module ModuleType = struct
786
      type t = Paths_types.Resolved_path.module_type
787

788
      let identifier : t -> Identifier.ModuleType.t option =
789
        parent_module_type_identifier
790
    end
791

792
    module Type = struct
793
      type t = Paths_types.Resolved_path.type_
794
    end
795

796
    module Value = struct
797
      type t = Paths_types.Resolved_path.value
798
    end
799

800
    module ClassType = struct
801
      type t = Paths_types.Resolved_path.class_type
802
    end
803

804
    let rec identifier : t -> Identifier.t option =
805
      let parent p f =
806
        match parent_module_identifier p with
82,823✔
807
        | None -> None
14✔
808
        | Some id -> Some (f id :> Identifier.t)
82,809✔
809
      in
810
      function
811
      | `Identifier id -> Some id
180,364✔
812
      | `CoreType _ -> None
44,227✔
813
      | `Subst (sub, _) -> identifier (sub :> t)
×
814
      | `Hidden _p -> None
22✔
815
      | `Module (m, n) -> parent m (fun p -> Identifier.Mk.module_ (p, n))
438✔
816
      | `Canonical (_, `Resolved p) -> identifier (p :> t)
371✔
817
      | `Canonical (p, _) -> identifier (p :> t)
5✔
818
      | `Apply (m, _) -> identifier (m :> t)
17✔
819
      | `Type (m, n) -> parent m (fun p -> Identifier.Mk.type_ (p, n))
82,060✔
820
      | `Value (m, n) -> parent m (fun p -> Identifier.Mk.value (p, n))
11✔
821
      | `ModuleType (m, n) ->
282✔
822
          parent m (fun p -> Identifier.Mk.module_type (p, n))
282✔
823
      | `Class (m, n) -> parent m (fun p -> Identifier.Mk.class_ (p, n))
18✔
824
      | `ClassType (m, n) -> parent m (fun p -> Identifier.Mk.class_type (p, n))
×
825
      | `Alias (dest, `Resolved src) ->
×
826
          if is_resolved_hidden ~weak_canonical_test:false (dest :> t) then
827
            identifier (src :> t)
×
828
          else identifier (dest :> t)
×
829
      | `Alias (dest, _src) -> identifier (dest :> t)
20,173✔
830
      | `AliasModuleType (sub, orig) ->
140✔
831
          if is_resolved_hidden ~weak_canonical_test:false (sub :> t) then
832
            identifier (orig :> t)
×
833
          else identifier (sub :> t)
140✔
834
      | `SubstT (p, _) -> identifier (p :> t)
×
835
      | `CanonicalModuleType (_, `Resolved p) -> identifier (p :> t)
4✔
836
      | `CanonicalModuleType (p, _) -> identifier (p :> t)
×
837
      | `CanonicalType (_, `Resolved p) -> identifier (p :> t)
8✔
838
      | `CanonicalType (p, _) -> identifier (p :> t)
×
839
      | `OpaqueModule m -> identifier (m :> t)
9✔
840
      | `OpaqueModuleType mt -> identifier (mt :> t)
260✔
841
      | `Substituted m -> identifier (m :> t)
8✔
842
      | `SubstitutedMT m -> identifier (m :> t)
×
843
      | `SubstitutedCT m -> identifier (m :> t)
×
844
      | `SubstitutedT m -> identifier (m :> t)
×
845

846
    let is_hidden r = is_resolved_hidden ~weak_canonical_test:false r
1,261✔
847
  end
848

849
  module Module = struct
850
    type t = Paths_types.Path.module_
851
  end
852

853
  module ModuleType = struct
854
    type t = Paths_types.Path.module_type
855
  end
856

857
  module Type = struct
858
    type t = Paths_types.Path.type_
859
  end
860

861
  module Value = struct
862
    type t = Paths_types.Path.value
863
  end
864

865
  module ClassType = struct
866
    type t = Paths_types.Path.class_type
867
  end
868

869
  let is_hidden = is_path_hidden
870
end
871

872
module Fragment = struct
873
  module Resolved = struct
874
    type t = Paths_types.Resolved_fragment.any
875

876
    type root = Paths_types.Resolved_fragment.root
877

878
    module Signature = struct
879
      type t = Paths_types.Resolved_fragment.signature
880

881
      let rec sgidentifier : t -> Identifier.Signature.t option = function
882
        | `Root (`ModuleType i) ->
249✔
883
            (Path.Resolved.parent_module_type_identifier i
884
              :> Identifier.Signature.t option)
885
        | `Root (`Module i) -> Path.Resolved.parent_module_identifier i
17✔
886
        | `Subst (s, _) ->
8✔
887
            (Path.Resolved.parent_module_type_identifier s
888
              :> Identifier.Signature.t option)
889
        | `Alias (i, _) -> Path.Resolved.parent_module_identifier i
16✔
890
        | `Module (m, n) -> (
17✔
891
            match sgidentifier m with
892
            | None -> None
×
893
            | Some p -> Some (Identifier.Mk.module_ (p, n)))
17✔
894
        | `OpaqueModule m -> sgidentifier (m :> t)
×
895
    end
896

897
    module Module = struct
898
      type t = Paths_types.Resolved_fragment.module_
899
    end
900

901
    module ModuleType = struct
902
      type t = Paths_types.Resolved_fragment.module_type
903
    end
904

905
    module Type = struct
906
      type t = Paths_types.Resolved_fragment.type_
907
    end
908

909
    type leaf = Paths_types.Resolved_fragment.leaf
910

911
    let rec identifier : t -> Identifier.t option = function
912
      | `Root (`ModuleType _r) -> assert false
913
      | `Root (`Module _r) -> assert false
914
      | `Subst (s, _) ->
×
915
          (Path.Resolved.ModuleType.identifier s :> Identifier.t option)
916
      | `Alias (p, _) ->
×
917
          (Path.Resolved.parent_module_identifier p :> Identifier.t option)
918
      | `Module (m, n) -> (
80✔
919
          match Signature.sgidentifier m with
920
          | None -> None
×
921
          | Some p -> Some (Identifier.Mk.module_ (p, n)))
80✔
922
      | `Module_type (m, n) -> (
48✔
923
          match Signature.sgidentifier m with
924
          | None -> None
×
925
          | Some p -> Some (Identifier.Mk.module_type (p, n)))
48✔
926
      | `Type (m, n) -> (
162✔
927
          match Signature.sgidentifier m with
928
          | None -> None
×
929
          | Some p -> Some (Identifier.Mk.type_ (p, n)))
162✔
930
      | `Class (m, n) -> (
×
931
          match Signature.sgidentifier m with
932
          | None -> None
×
933
          | Some p -> Some (Identifier.Mk.class_ (p, n)))
×
934
      | `ClassType (m, n) -> (
×
935
          match Signature.sgidentifier m with
936
          | None -> None
×
937
          | Some p -> Some (Identifier.Mk.class_type (p, n)))
×
938
      | `OpaqueModule m -> identifier (m :> t)
×
939

940
    let rec is_hidden : t -> bool = function
941
      | `Root (`ModuleType r) -> Path.Resolved.(is_hidden (r :> t))
249✔
942
      | `Root (`Module r) -> Path.Resolved.(is_hidden (r :> t))
17✔
943
      | `Subst (s, _) -> Path.Resolved.(is_hidden (s :> t))
8✔
944
      | `Alias (s, _) -> Path.Resolved.(is_hidden (s :> t))
16✔
945
      | `Module (m, _)
97✔
946
      | `Module_type (m, _)
48✔
947
      | `Type (m, _)
162✔
948
      | `Class (m, _)
×
949
      | `ClassType (m, _) ->
×
950
          is_hidden (m :> t)
951
      | `OpaqueModule m -> is_hidden (m :> t)
×
952
  end
953

954
  type t = Paths_types.Fragment.any
955

956
  module Signature = struct
957
    type t = Paths_types.Fragment.signature
958
  end
959

960
  module Module = struct
961
    type t = Paths_types.Fragment.module_
962
  end
963

964
  module ModuleType = struct
965
    type t = Paths_types.Fragment.module_type
966
  end
967

968
  module Type = struct
969
    type t = Paths_types.Fragment.type_
970
  end
971

972
  type leaf = Paths_types.Fragment.leaf
973
end
974

975
module Reference = struct
976
  module Resolved = struct
977
    open Paths_types.Resolved_reference
978

979
    type t = Paths_types.Resolved_reference.any
980

981
    let rec parent_signature_identifier :
982
        signature -> Identifier.Signature.t option = function
983
      | `Identifier id -> Some id
492✔
984
      | `Hidden _s -> None
×
985
      | `Alias (sub, orig) ->
77✔
986
          if Path.Resolved.(is_hidden (sub :> t)) then
77✔
987
            parent_signature_identifier (orig :> signature)
×
988
          else
989
            (Path.Resolved.parent_module_identifier sub
77✔
990
              :> Identifier.Signature.t option)
991
      | `AliasModuleType (sub, orig) ->
2✔
992
          if Path.Resolved.(is_hidden (sub :> t)) then
2✔
993
            parent_signature_identifier (orig :> signature)
×
994
          else
995
            (Path.Resolved.parent_module_type_identifier sub
2✔
996
              :> Identifier.Signature.t option)
997
      | `Module (m, n) -> (
84✔
998
          match parent_signature_identifier m with
999
          | None -> None
×
1000
          | Some p -> Some (Identifier.Mk.module_ (p, n)))
84✔
1001
      | `ModuleType (m, n) -> (
110✔
1002
          match parent_signature_identifier m with
1003
          | None -> None
×
1004
          | Some p -> Some (Identifier.Mk.module_type (p, n)))
110✔
1005

1006
    and parent_type_identifier : datatype -> Identifier.DataType.t option =
1007
      function
1008
      | `Identifier id -> Some id
9✔
1009
      | `Type (sg, s) -> (
198✔
1010
          match parent_signature_identifier sg with
1011
          | None -> None
×
1012
          | Some p -> Some (Identifier.Mk.type_ (p, s)))
198✔
1013

1014
    and parent_class_signature_identifier :
1015
        class_signature -> Identifier.ClassSignature.t option = function
1016
      | `Identifier id -> Some id
×
1017
      | `Class (sg, s) -> (
×
1018
          match parent_signature_identifier sg with
1019
          | None -> None
×
1020
          | Some p -> Some (Identifier.Mk.class_ (p, s)))
×
1021
      | `ClassType (sg, s) -> (
×
1022
          match parent_signature_identifier sg with
1023
          | None -> None
×
1024
          | Some p -> Some (Identifier.Mk.class_type (p, s)))
×
1025

1026
    and field_parent_identifier :
1027
        field_parent -> Identifier.FieldParent.t option = function
1028
      | `Identifier id -> Some id
×
1029
      | (`Hidden _ | `Alias _ | `AliasModuleType _ | `Module _ | `ModuleType _)
×
1030
        as sg ->
1031
          (parent_signature_identifier sg :> Identifier.FieldParent.t option)
1032
      | `Type _ as t ->
194✔
1033
          (parent_type_identifier t :> Identifier.FieldParent.t option)
1034

1035
    and unboxed_field_parent_identifier : unboxed_field_parent -> Identifier.UnboxedFieldParent.t option =
1036
      function
NEW
1037
      | `Identifier id -> Some id
×
NEW
1038
      | `Type _ as t -> (parent_type_identifier t :> Identifier.UnboxedFieldParent.t option)
×
1039

1040
    and label_parent_identifier :
1041
        label_parent -> Identifier.LabelParent.t option = function
1042
      | `Identifier id -> Some id
22✔
1043
      | (`Class _ | `ClassType _) as c ->
×
1044
          (parent_class_signature_identifier c
1045
            :> Identifier.LabelParent.t option)
1046
      | ( `Hidden _ | `Alias _ | `AliasModuleType _ | `Module _ | `ModuleType _
×
1047
        | `Type _ ) as r ->
194✔
1048
          (field_parent_identifier r :> Identifier.LabelParent.t option)
1049

1050
    and identifier : t -> Identifier.t option = function
1051
      | `Identifier id -> Some id
2,647✔
NEW
1052
      | `UnboxedField (p, n) -> (
×
1053
          match unboxed_field_parent_identifier p with
NEW
1054
          | None -> None
×
NEW
1055
          | Some p -> Some (Identifier.Mk.unboxed_field (p, n)))
×
1056
      | ( `Alias _ | `AliasModuleType _ | `Module _ | `Hidden _ | `Type _
×
1057
        | `Class _ | `ClassType _ | `ModuleType _ ) as r ->
×
1058
          (label_parent_identifier r :> Identifier.t option)
1059
      | `Field (p, n) -> (
×
1060
          match field_parent_identifier p with
1061
          | None -> None
×
1062
          | Some p -> Some (Identifier.Mk.field (p, n)))
×
1063
      | `PolyConstructor (s, n) -> (
8✔
1064
          (* Uses an identifier for constructor even though it is not
1065
             one. Document must make the links correspond. *)
1066
          match parent_type_identifier s with
1067
          | None -> None
×
1068
          | Some p -> Some (Identifier.Mk.constructor (p, n)))
8✔
1069
      | `Constructor (s, n) -> (
5✔
1070
          match parent_type_identifier s with
1071
          | None -> None
×
1072
          | Some p -> Some (Identifier.Mk.constructor (p, n)))
5✔
1073
      | `Extension (p, q) -> (
3✔
1074
          match parent_signature_identifier p with
1075
          | None -> None
×
1076
          | Some p -> Some (Identifier.Mk.extension (p, q)))
3✔
1077
      | `ExtensionDecl (p, q, r) -> (
2✔
1078
          match parent_signature_identifier p with
1079
          | None -> None
×
1080
          | Some p -> Some (Identifier.Mk.extension_decl (p, (q, r))))
2✔
1081
      | `Exception (p, q) -> (
126✔
1082
          match parent_signature_identifier p with
1083
          | None -> None
×
1084
          | Some p -> Some (Identifier.Mk.exception_ (p, q)))
126✔
1085
      | `Value (p, q) -> (
36✔
1086
          match parent_signature_identifier p with
1087
          | None -> None
×
1088
          | Some p -> Some (Identifier.Mk.value (p, q)))
36✔
1089
      | `Method (p, q) -> (
×
1090
          match parent_class_signature_identifier p with
1091
          | None -> None
×
1092
          | Some p -> Some (Identifier.Mk.method_ (p, q)))
×
1093
      | `InstanceVariable (p, q) -> (
×
1094
          match parent_class_signature_identifier p with
1095
          | None -> None
×
1096
          | Some p -> Some (Identifier.Mk.instance_variable (p, q)))
×
1097
      | `Label (p, q) -> (
54✔
1098
          match label_parent_identifier p with
1099
          | None -> None
×
1100
          | Some p -> Some (Identifier.Mk.label (p, q)))
54✔
1101

1102
    module Signature = struct
1103
      type t = Paths_types.Resolved_reference.signature
1104
    end
1105

1106
    module ClassSignature = struct
1107
      type t = Paths_types.Resolved_reference.class_signature
1108
    end
1109

1110
    module DataType = struct
1111
      type t = Paths_types.Resolved_reference.datatype
1112
    end
1113

1114
    module FieldParent = struct
1115
      type t = Paths_types.Resolved_reference.field_parent
1116
    end
1117

1118
    module UnboxedFieldParent = struct
1119
      type t = Paths_types.Resolved_reference.unboxed_field_parent
1120
    end
1121

1122
    module LabelParent = struct
1123
      type t = Paths_types.Resolved_reference.label_parent
1124
    end
1125

1126
    module Module = struct
1127
      type t = Paths_types.Resolved_reference.module_
1128
    end
1129

1130
    module ModuleType = struct
1131
      type t = Paths_types.Resolved_reference.module_type
1132
    end
1133

1134
    module Type = struct
1135
      type t = Paths_types.Resolved_reference.type_
1136
    end
1137

1138
    module Constructor = struct
1139
      type t = Paths_types.Resolved_reference.constructor
1140
    end
1141

1142
    module Field = struct
1143
      type t = Paths_types.Resolved_reference.field
1144
    end
1145

1146
    module UnboxedField = struct
1147
      type t = Paths_types.Resolved_reference.unboxed_field
1148
    end
1149

1150
    module Extension = struct
1151
      type t = Paths_types.Resolved_reference.extension
1152
    end
1153

1154
    module ExtensionDecl = struct
1155
      type t = Paths_types.Resolved_reference.extension_decl
1156
    end
1157

1158
    module Exception = struct
1159
      type t = Paths_types.Resolved_reference.exception_
1160
    end
1161

1162
    module Value = struct
1163
      type t = Paths_types.Resolved_reference.value
1164
    end
1165

1166
    module Class = struct
1167
      type t = Paths_types.Resolved_reference.class_
1168
    end
1169

1170
    module ClassType = struct
1171
      type t = Paths_types.Resolved_reference.class_type
1172
    end
1173

1174
    module Method = struct
1175
      type t = Paths_types.Resolved_reference.method_
1176
    end
1177

1178
    module InstanceVariable = struct
1179
      type t = Paths_types.Resolved_reference.instance_variable
1180
    end
1181

1182
    module Label = struct
1183
      type t = Paths_types.Resolved_reference.label
1184
    end
1185

1186
    module Page = struct
1187
      type t = Paths_types.Resolved_reference.page
1188
    end
1189

1190
    module Asset = struct
1191
      let identifier = function `Identifier id -> id
9✔
1192

1193
      type t = Paths_types.Resolved_reference.asset
1194
    end
1195
  end
1196

1197
  type t = Paths_types.Reference.any
1198

1199
  type tag_any = Paths_types.Reference.tag_any
1200
  type tag_hierarchy = Paths_types.Reference.tag_hierarchy
1201

1202
  module Signature = struct
1203
    type t = Paths_types.Reference.signature
1204
  end
1205

1206
  module ClassSignature = struct
1207
    type t = Paths_types.Reference.class_signature
1208
  end
1209

1210
  module DataType = struct
1211
    type t = Paths_types.Reference.datatype
1212
  end
1213

1214
  module FragmentTypeParent = struct
1215
    type t = Paths_types.Reference.fragment_type_parent
1216
  end
1217

1218
  module LabelParent = struct
1219
    type t = Paths_types.Reference.label_parent
1220
  end
1221

1222
  module Module = struct
1223
    type t = Paths_types.Reference.module_
1224
  end
1225

1226
  module ModuleType = struct
1227
    type t = Paths_types.Reference.module_type
1228
  end
1229

1230
  module Type = struct
1231
    type t = Paths_types.Reference.type_
1232
  end
1233

1234
  module Constructor = struct
1235
    type t = Paths_types.Reference.constructor
1236
  end
1237

1238
  module Field = struct
1239
    type t = Paths_types.Reference.field
1240
  end
1241

1242
  module UnboxedField = struct
1243
    type t = Paths_types.Reference.unboxed_field
1244
  end
1245

1246
  module Extension = struct
1247
    type t = Paths_types.Reference.extension
1248
  end
1249

1250
  module ExtensionDecl = struct
1251
    type t = Paths_types.Reference.extension_decl
1252
  end
1253

1254
  module Exception = struct
1255
    type t = Paths_types.Reference.exception_
1256
  end
1257

1258
  module Value = struct
1259
    type t = Paths_types.Reference.value
1260
  end
1261

1262
  module Class = struct
1263
    type t = Paths_types.Reference.class_
1264
  end
1265

1266
  module ClassType = struct
1267
    type t = Paths_types.Reference.class_type
1268
  end
1269

1270
  module Method = struct
1271
    type t = Paths_types.Reference.method_
1272
  end
1273

1274
  module InstanceVariable = struct
1275
    type t = Paths_types.Reference.instance_variable
1276
  end
1277

1278
  module Label = struct
1279
    type t = Paths_types.Reference.label
1280
  end
1281

1282
  module Page = struct
1283
    type t = Paths_types.Reference.page
1284
  end
1285

1286
  module Asset = struct
1287
    type t = Paths_types.Reference.asset
1288
  end
1289

1290
  module Hierarchy = struct
1291
    type t = Paths_types.Reference.hierarchy
1292
  end
1293
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc