Skip to content

Commit 2dad3bf

Browse files
committed
Remove small dead code
1 parent 809c4ca commit 2dad3bf

File tree

3 files changed

+0
-129
lines changed

3 files changed

+0
-129
lines changed

src/document/comment.ml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -56,39 +56,6 @@ module Reference = struct
5656
render_resolved (r :> t) ^ "." ^ InstanceVariableName.to_string s
5757
| `Label (r, s) -> render_resolved (r :> t) ^ ":" ^ LabelName.to_string s
5858

59-
let rec ref_to_string : Reference.t -> string =
60-
let open Reference in
61-
function
62-
| `Root (s, _) -> s
63-
| `Dot (parent, s) -> ref_to_string (parent :> t) ^ "." ^ s
64-
| `Module (parent, s) ->
65-
ref_to_string (parent :> t) ^ "." ^ ModuleName.to_string s
66-
| `ModuleType (parent, s) ->
67-
ref_to_string (parent :> t) ^ "." ^ ModuleTypeName.to_string s
68-
| `Type (parent, s) ->
69-
ref_to_string (parent :> t) ^ "." ^ TypeName.to_string s
70-
| `Constructor (parent, s) ->
71-
ref_to_string (parent :> t) ^ "." ^ ConstructorName.to_string s
72-
| `Field (parent, s) ->
73-
ref_to_string (parent :> t) ^ "." ^ FieldName.to_string s
74-
| `Extension (parent, s) ->
75-
ref_to_string (parent :> t) ^ "." ^ ExtensionName.to_string s
76-
| `Exception (parent, s) ->
77-
ref_to_string (parent :> t) ^ "." ^ ExceptionName.to_string s
78-
| `Value (parent, s) ->
79-
ref_to_string (parent :> t) ^ "." ^ ValueName.to_string s
80-
| `Class (parent, s) ->
81-
ref_to_string (parent :> t) ^ "." ^ ClassName.to_string s
82-
| `ClassType (parent, s) ->
83-
ref_to_string (parent :> t) ^ "." ^ ClassTypeName.to_string s
84-
| `Method (parent, s) ->
85-
ref_to_string (parent :> t) ^ "." ^ MethodName.to_string s
86-
| `InstanceVariable (parent, s) ->
87-
ref_to_string (parent :> t) ^ "." ^ InstanceVariableName.to_string s
88-
| `Label (parent, s) ->
89-
ref_to_string (parent :> t) ^ "." ^ LabelName.to_string s
90-
| `Resolved r -> render_resolved r
91-
9259
(* This is the entry point. stop_before is false on entry, true on recursive
9360
call. *)
9461
let rec to_ir : ?text:Inline.t -> stop_before:bool -> Reference.t -> Inline.t

src/document/url.ml

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ module Path = struct
7676

7777
type t = { kind : string; parent : t option; name : string }
7878

79-
let last t = t.name
80-
8179
let mk ?parent kind name = { kind; parent; name }
8280

8381
let rec from_identifier : source -> t = function
@@ -270,98 +268,12 @@ type t = Anchor.t
270268

271269
let from_path page = { Anchor.page; anchor = ""; kind = page.kind }
272270

273-
let page x = x.Anchor.page
274-
275271
let from_identifier ~stop_before = function
276272
| #Path.source as p when not stop_before ->
277273
Ok (from_path @@ Path.from_identifier p)
278274
| p -> Anchor.from_identifier p
279275

280-
let from_identifier_exn ~stop_before id =
281-
match from_identifier ~stop_before id with
282-
| Error e -> failwith (Error.to_string e)
283-
| Ok url -> url
284-
285276
let kind id =
286277
match Anchor.from_identifier id with
287278
| Error e -> failwith (Error.to_string e)
288279
| Ok { kind; _ } -> kind
289-
290-
(* module Of_path = struct
291-
* let rec to_html : stop_before:bool -> Path.t -> _ =
292-
* fun ~stop_before path ->
293-
* match path with
294-
* | `Root root -> [ Html.txt root ]
295-
* | `Forward root -> [ Html.txt root ] (\* FIXME *\)
296-
* | `Dot (prefix, suffix) ->
297-
* let link = to_html ~stop_before:true (prefix :> Path.t) in
298-
* link @ [ Html.txt ("." ^ suffix) ]
299-
* | `Apply (p1, p2) ->
300-
* let link1 = to_html ~stop_before (p1 :> Path.t) in
301-
* let link2 = to_html ~stop_before (p2 :> Path.t) in
302-
* link1 @ Html.txt "(":: link2 @ [ Html.txt ")" ]
303-
* | `Resolved rp ->
304-
* let id = Path.Resolved.identifier rp in
305-
* let txt = Url.render_path path in
306-
* begin match Id.href ~stop_before id with
307-
* | href -> [ Html.a ~a:[ Html.a_href href ] [ Html.txt txt ] ]
308-
* | exception Id.Not_linkable -> [ Html.txt txt ]
309-
* | exception exn ->
310-
* Printf.eprintf "Id.href failed: %S\n%!" (Printexc.to_string exn);
311-
* [ Html.txt txt ]
312-
* end
313-
* end *)
314-
315-
(* module Of_fragment = struct
316-
* let dot prefix suffix =
317-
* match prefix with
318-
* | "" -> suffix
319-
* | _ -> prefix ^ "." ^ suffix
320-
*
321-
* let rec render_raw : Fragment.t -> string =
322-
* fun fragment ->
323-
* match fragment with
324-
* | `Resolved rr -> render_resolved rr
325-
* | `Dot (prefix, suffix) -> dot (render_raw (prefix :> Fragment.t)) suffix
326-
*
327-
* and render_resolved : Fragment.Resolved.t -> string =
328-
* let open Fragment.Resolved in
329-
* fun fragment ->
330-
* match fragment with
331-
* | `Root -> ""
332-
* | `Subst (_, rr) -> render_resolved (rr :> t)
333-
* | `SubstAlias (_, rr) -> render_resolved (rr :> t)
334-
* | `Module (rr, s) -> dot (render_resolved (rr :> t)) (ModuleName.to_string s)
335-
* | `Type (rr, s) -> dot (render_resolved (rr :> t)) (TypeName.to_string s)
336-
* | `Class (rr, s) -> dot (render_resolved ( rr :> t)) (ClassName.to_string s)
337-
* | `ClassType (rr, s) -> dot (render_resolved (rr :> t)) (ClassTypeName.to_string s)
338-
*
339-
* let rec to_html : stop_before:bool ->
340-
* Identifier.Signature.t -> Fragment.t -> _ =
341-
* fun ~stop_before id fragment ->
342-
* let open Fragment in
343-
* match fragment with
344-
* | `Resolved `Root ->
345-
* begin match Id.href ~stop_before:true (id :> Identifier.t) with
346-
* | href ->
347-
* [Html.a ~a:[Html.a_href href] [Html.txt (Identifier.name id)]]
348-
* | exception Id.Not_linkable -> [ Html.txt (Identifier.name id) ]
349-
* | exception exn ->
350-
* Printf.eprintf "[FRAG] Id.href failed: %S\n%!" (Printexc.to_string exn);
351-
* [ Html.txt (Identifier.name id) ]
352-
* end
353-
* | `Resolved rr ->
354-
* let id = Resolved.identifier id (rr :> Resolved.t) in
355-
* let txt = render_resolved rr in
356-
* begin match Id.href ~stop_before id with
357-
* | href ->
358-
* [ Html.a ~a:[ Html.a_href href ] [ Html.txt txt ] ]
359-
* | exception Id.Not_linkable -> [ Html.txt txt ]
360-
* | exception exn ->
361-
* Printf.eprintf "[FRAG] Id.href failed: %S\n%!" (Printexc.to_string exn);
362-
* [ Html.txt txt ]
363-
* end
364-
* | `Dot (prefix, suffix) ->
365-
* let link = to_html ~stop_before:true id (prefix :> Fragment.t) in
366-
* link @ [ Html.txt ("." ^ suffix) ]
367-
* end *)

src/document/url.mli

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
open Result
22
open Odoc_model.Paths
33

4-
val functor_arg_pos : Identifier.FunctorParameter.t -> int
5-
64
module Error : sig
75
type nonrec t =
86
| Not_linkable of string
@@ -20,8 +18,6 @@ module Path : sig
2018
[ Identifier.Page.t | Identifier.Signature.t | Identifier.ClassSignature.t ]
2119

2220
val from_identifier : [< source ] -> t
23-
24-
val last : t -> string
2521
end
2622

2723
module Anchor : sig
@@ -48,10 +44,6 @@ val from_path : Path.t -> t
4844

4945
val from_identifier : stop_before:bool -> Identifier.t -> (t, Error.t) result
5046

51-
val from_identifier_exn : stop_before:bool -> Identifier.t -> t
52-
5347
val kind : Identifier.t -> string
5448

5549
val render_path : Odoc_model.Paths.Path.t -> string
56-
57-
val page : t -> Path.t

0 commit comments

Comments
 (0)