File tree 4 files changed +8
-6
lines changed 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -453,7 +453,7 @@ and read_module_binding env parent mb =
453
453
| _ , _ -> false
454
454
#else
455
455
match canonical with
456
- | None -> Odoc_model.Root . contains_double_underscore (Ident. name mb.mb_id)
456
+ | None -> Odoc_model.Names . contains_double_underscore (Ident. name mb.mb_id)
457
457
| _ -> false
458
458
#endif
459
459
in
Original file line number Diff line number Diff line change @@ -632,7 +632,7 @@ and read_module_declaration env parent md =
632
632
| _ ,_ -> false
633
633
#else
634
634
match canonical with
635
- | None -> Odoc_model.Root . contains_double_underscore (Ident. name md.md_id)
635
+ | None -> Odoc_model.Names . contains_double_underscore (Ident. name md.md_id)
636
636
| _ -> false
637
637
#endif
638
638
in
Original file line number Diff line number Diff line change @@ -1111,6 +1111,8 @@ module Targets = struct
1111
1111
end
1112
1112
1113
1113
module Occurrences = struct
1114
+ open Or_error
1115
+
1114
1116
let has_occurrences_prefix input =
1115
1117
input |> Fs.File. basename |> Fs.File. to_string
1116
1118
|> Astring.String. is_prefix ~affix: " occurrences-"
@@ -1122,7 +1124,6 @@ module Occurrences = struct
1122
1124
else if not (has_occurrences_prefix f) then
1123
1125
Error (`Msg " Output file must be prefixed with 'occurrences-'." )
1124
1126
else Ok f
1125
- open Or_error
1126
1127
module Count = struct
1127
1128
let count directories dst warnings_options include_hidden =
1128
1129
dst_of_string dst >> = fun dst ->
Original file line number Diff line number Diff line change @@ -87,9 +87,10 @@ end = struct
87
87
()
88
88
89
89
let rec get t id =
90
- let ( >> = ) = Option. bind in
91
90
let do_ parent =
92
- get t (parent :> key ) >> = fun { sub; _ } -> H. find_opt sub id
91
+ get t (parent :> key ) |> function
92
+ | None -> None
93
+ | Some { sub; _ } -> ( try Some (H. find sub id) with Not_found -> None )
93
94
in
94
95
match id.iv with
95
96
| `InstanceVariable (parent , _ ) -> do_ parent
@@ -106,7 +107,7 @@ end = struct
106
107
| `Class (parent , _ ) -> do_ parent
107
108
| `Value (parent , _ ) -> do_ parent
108
109
| `ClassType (parent , _ ) -> do_ parent
109
- | `Root _ -> H. find_opt t id
110
+ | `Root _ -> ( try Some ( H. find t id) with Not_found -> None )
110
111
| `SourcePage _ | `Page _ | `LeafPage _ | `CoreType _ | `SourceLocation _
111
112
| `CoreException _ | `Label _ | `SourceLocationMod _ | `Result _
112
113
| `AssetFile _ | `SourceDir _ | `SourceLocationInternal _ ->
You can’t perform that action at this time.
0 commit comments