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

ocaml / odoc / 3054

19 Feb 2026 11:33AM UTC coverage: 71.709% (-1.2%) from 72.946%
3054

Pull #1399

github

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

20 of 281 new or added lines in 21 files covered. (7.12%)

162 existing lines in 11 files now uncovered.

10400 of 14503 relevant lines covered (71.71%)

7007.14 hits per line

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

62.98
/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, _); _ } ->
×
173
          (p : unboxed_field_parent :> label_parent)
174

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

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

179
  let hash x = x.ihash
492✔
180

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

183
  type any = t
184

185
  type any_pv = t_pv
186

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

317
    type t_pv = Paths_types.Identifier.extension_decl_pv
318

319
    let equal = equal
320

321
    let hash = hash
322

323
    let compare = compare
324
  end
325

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

462
    type t = Id.path_any
463
  end
464

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

658
module Path = struct
659
  type t = Paths_types.Path.any
660

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

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

736
  module Resolved = struct
737
    type t = Paths_types.Resolved_path.any
738

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

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

780
    module Module = struct
781
      type t = Paths_types.Resolved_path.module_
782

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

787
    module ModuleType = struct
788
      type t = Paths_types.Resolved_path.module_type
789

790
      let identifier : t -> Identifier.ModuleType.t option =
791
        parent_module_type_identifier
792
    end
793

794
    module Type = struct
795
      type t = Paths_types.Resolved_path.type_
796
    end
797

798
    module Value = struct
799
      type t = Paths_types.Resolved_path.value
800
    end
801

802
    module ClassType = struct
803
      type t = Paths_types.Resolved_path.class_type
804
    end
805

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

848
    let is_hidden r = is_resolved_hidden ~weak_canonical_test:false r
1,261✔
849
  end
850

851
  module Module = struct
852
    type t = Paths_types.Path.module_
853
  end
854

855
  module ModuleType = struct
856
    type t = Paths_types.Path.module_type
857
  end
858

859
  module Type = struct
860
    type t = Paths_types.Path.type_
861
  end
862

863
  module Value = struct
864
    type t = Paths_types.Path.value
865
  end
866

867
  module ClassType = struct
868
    type t = Paths_types.Path.class_type
869
  end
870

871
  let is_hidden = is_path_hidden
872
end
873

874
module Fragment = struct
875
  module Resolved = struct
876
    type t = Paths_types.Resolved_fragment.any
877

878
    type root = Paths_types.Resolved_fragment.root
879

880
    module Signature = struct
881
      type t = Paths_types.Resolved_fragment.signature
882

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

899
    module Module = struct
900
      type t = Paths_types.Resolved_fragment.module_
901
    end
902

903
    module ModuleType = struct
904
      type t = Paths_types.Resolved_fragment.module_type
905
    end
906

907
    module Type = struct
908
      type t = Paths_types.Resolved_fragment.type_
909
    end
910

911
    type leaf = Paths_types.Resolved_fragment.leaf
912

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

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

956
  type t = Paths_types.Fragment.any
957

958
  module Signature = struct
959
    type t = Paths_types.Fragment.signature
960
  end
961

962
  module Module = struct
963
    type t = Paths_types.Fragment.module_
964
  end
965

966
  module ModuleType = struct
967
    type t = Paths_types.Fragment.module_type
968
  end
969

970
  module Type = struct
971
    type t = Paths_types.Fragment.type_
972
  end
973

974
  type leaf = Paths_types.Fragment.leaf
975
end
976

977
module Reference = struct
978
  module Resolved = struct
979
    open Paths_types.Resolved_reference
980

981
    type t = Paths_types.Resolved_reference.any
982

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

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

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

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

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

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

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

1106
    module Signature = struct
1107
      type t = Paths_types.Resolved_reference.signature
1108
    end
1109

1110
    module ClassSignature = struct
1111
      type t = Paths_types.Resolved_reference.class_signature
1112
    end
1113

1114
    module DataType = struct
1115
      type t = Paths_types.Resolved_reference.datatype
1116
    end
1117

1118
    module FieldParent = struct
1119
      type t = Paths_types.Resolved_reference.field_parent
1120
    end
1121

1122
    module UnboxedFieldParent = struct
1123
      type t = Paths_types.Resolved_reference.unboxed_field_parent
1124
    end
1125

1126
    module LabelParent = struct
1127
      type t = Paths_types.Resolved_reference.label_parent
1128
    end
1129

1130
    module Module = struct
1131
      type t = Paths_types.Resolved_reference.module_
1132
    end
1133

1134
    module ModuleType = struct
1135
      type t = Paths_types.Resolved_reference.module_type
1136
    end
1137

1138
    module Type = struct
1139
      type t = Paths_types.Resolved_reference.type_
1140
    end
1141

1142
    module Constructor = struct
1143
      type t = Paths_types.Resolved_reference.constructor
1144
    end
1145

1146
    module Field = struct
1147
      type t = Paths_types.Resolved_reference.field
1148
    end
1149

1150
    module UnboxedField = struct
1151
      type t = Paths_types.Resolved_reference.unboxed_field
1152
    end
1153

1154
    module Extension = struct
1155
      type t = Paths_types.Resolved_reference.extension
1156
    end
1157

1158
    module ExtensionDecl = struct
1159
      type t = Paths_types.Resolved_reference.extension_decl
1160
    end
1161

1162
    module Exception = struct
1163
      type t = Paths_types.Resolved_reference.exception_
1164
    end
1165

1166
    module Value = struct
1167
      type t = Paths_types.Resolved_reference.value
1168
    end
1169

1170
    module Class = struct
1171
      type t = Paths_types.Resolved_reference.class_
1172
    end
1173

1174
    module ClassType = struct
1175
      type t = Paths_types.Resolved_reference.class_type
1176
    end
1177

1178
    module Method = struct
1179
      type t = Paths_types.Resolved_reference.method_
1180
    end
1181

1182
    module InstanceVariable = struct
1183
      type t = Paths_types.Resolved_reference.instance_variable
1184
    end
1185

1186
    module Label = struct
1187
      type t = Paths_types.Resolved_reference.label
1188
    end
1189

1190
    module Page = struct
1191
      type t = Paths_types.Resolved_reference.page
1192
    end
1193

1194
    module Asset = struct
1195
      let identifier = function `Identifier id -> id
9✔
1196

1197
      type t = Paths_types.Resolved_reference.asset
1198
    end
1199
  end
1200

1201
  type t = Paths_types.Reference.any
1202

1203
  type tag_any = Paths_types.Reference.tag_any
1204
  type tag_hierarchy = Paths_types.Reference.tag_hierarchy
1205

1206
  module Signature = struct
1207
    type t = Paths_types.Reference.signature
1208
  end
1209

1210
  module ClassSignature = struct
1211
    type t = Paths_types.Reference.class_signature
1212
  end
1213

1214
  module DataType = struct
1215
    type t = Paths_types.Reference.datatype
1216
  end
1217

1218
  module FragmentTypeParent = struct
1219
    type t = Paths_types.Reference.fragment_type_parent
1220
  end
1221

1222
  module LabelParent = struct
1223
    type t = Paths_types.Reference.label_parent
1224
  end
1225

1226
  module Module = struct
1227
    type t = Paths_types.Reference.module_
1228
  end
1229

1230
  module ModuleType = struct
1231
    type t = Paths_types.Reference.module_type
1232
  end
1233

1234
  module Type = struct
1235
    type t = Paths_types.Reference.type_
1236
  end
1237

1238
  module Constructor = struct
1239
    type t = Paths_types.Reference.constructor
1240
  end
1241

1242
  module Field = struct
1243
    type t = Paths_types.Reference.field
1244
  end
1245

1246
  module UnboxedField = struct
1247
    type t = Paths_types.Reference.unboxed_field
1248
  end
1249

1250
  module Extension = struct
1251
    type t = Paths_types.Reference.extension
1252
  end
1253

1254
  module ExtensionDecl = struct
1255
    type t = Paths_types.Reference.extension_decl
1256
  end
1257

1258
  module Exception = struct
1259
    type t = Paths_types.Reference.exception_
1260
  end
1261

1262
  module Value = struct
1263
    type t = Paths_types.Reference.value
1264
  end
1265

1266
  module Class = struct
1267
    type t = Paths_types.Reference.class_
1268
  end
1269

1270
  module ClassType = struct
1271
    type t = Paths_types.Reference.class_type
1272
  end
1273

1274
  module Method = struct
1275
    type t = Paths_types.Reference.method_
1276
  end
1277

1278
  module InstanceVariable = struct
1279
    type t = Paths_types.Reference.instance_variable
1280
  end
1281

1282
  module Label = struct
1283
    type t = Paths_types.Reference.label
1284
  end
1285

1286
  module Page = struct
1287
    type t = Paths_types.Reference.page
1288
  end
1289

1290
  module Asset = struct
1291
    type t = Paths_types.Reference.asset
1292
  end
1293

1294
  module Hierarchy = struct
1295
    type t = Paths_types.Reference.hierarchy
1296
  end
1297
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