Skip to content

Commit 559f761

Browse files
panglesdjonludlam
authored andcommitted
Revert "Adding constructors and datatypes to component path"
This reverts commit e38f414.
1 parent 677b680 commit 559f761

File tree

6 files changed

+0
-153
lines changed

6 files changed

+0
-153
lines changed

src/xref2/component.ml

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,24 +1036,6 @@ module Fmt = struct
10361036
Format.fprintf ppf "%a.%s" resolved_parent_path p
10371037
(Odoc_model.Names.TypeName.to_string t)
10381038

1039-
and resolved_datatype_path :
1040-
Format.formatter -> Cpath.Resolved.datatype -> unit =
1041-
fun ppf p ->
1042-
match p with
1043-
| `Local id -> Format.fprintf ppf "%a" Ident.fmt id
1044-
| `Gpath p ->
1045-
Format.fprintf ppf "%a" model_resolved_path
1046-
(p :> Odoc_model.Paths.Path.Resolved.t)
1047-
| `Substituted x ->
1048-
Format.fprintf ppf "substituted(%a)" resolved_datatype_path x
1049-
| `CanonicalDataType (t1, t2) ->
1050-
Format.fprintf ppf "canonicalty(%a,%a)" resolved_datatype_path t1
1051-
model_path
1052-
(t2 :> Odoc_model.Paths.Path.t)
1053-
| `Type (p, t) ->
1054-
Format.fprintf ppf "%a.%s" resolved_parent_path p
1055-
(Odoc_model.Names.TypeName.to_string t)
1056-
10571039
and resolved_value_path : Format.formatter -> Cpath.Resolved.value -> unit =
10581040
fun ppf p ->
10591041
match p with
@@ -1064,14 +1046,6 @@ module Fmt = struct
10641046
Format.fprintf ppf "%a" model_resolved_path
10651047
(p :> Odoc_model.Paths.Path.Resolved.t)
10661048

1067-
and resolved_constructor_path :
1068-
Format.formatter -> Cpath.Resolved.constructor -> unit =
1069-
fun ppf p ->
1070-
match p with
1071-
| `Constructor (p, t) ->
1072-
Format.fprintf ppf "%a.%s" resolved_datatype_path p
1073-
(Odoc_model.Names.ConstructorName.to_string t)
1074-
10751049
and resolved_parent_path : Format.formatter -> Cpath.Resolved.parent -> unit =
10761050
fun ppf p ->
10771051
match p with
@@ -1100,21 +1074,6 @@ module Fmt = struct
11001074
Format.fprintf ppf "%a.%s" resolved_parent_path p
11011075
(Odoc_model.Names.TypeName.to_string t)
11021076

1103-
and datatype_path : Format.formatter -> Cpath.datatype -> unit =
1104-
fun ppf p ->
1105-
match p with
1106-
| `Resolved r -> Format.fprintf ppf "r(%a)" resolved_datatype_path r
1107-
| `Identifier (id, b) ->
1108-
Format.fprintf ppf "identifier(%a, %b)" model_identifier
1109-
(id :> Odoc_model.Paths.Identifier.t)
1110-
b
1111-
| `Local (id, b) -> Format.fprintf ppf "local(%a,%b)" Ident.fmt id b
1112-
| `Substituted s -> Format.fprintf ppf "substituted(%a)" datatype_path s
1113-
| `Dot (m, s) -> Format.fprintf ppf "%a.%s" module_path m s
1114-
| `Type (p, t) ->
1115-
Format.fprintf ppf "%a.%s" resolved_parent_path p
1116-
(Odoc_model.Names.TypeName.to_string t)
1117-
11181077
and value_path : Format.formatter -> Cpath.value -> unit =
11191078
fun ppf p ->
11201079
match p with
@@ -1128,15 +1087,6 @@ module Fmt = struct
11281087
(id :> Odoc_model.Paths.Identifier.t)
11291088
b
11301089

1131-
and constructor_path : Format.formatter -> Cpath.constructor -> unit =
1132-
fun ppf p ->
1133-
match p with
1134-
| `Resolved r -> Format.fprintf ppf "r(%a)" resolved_constructor_path r
1135-
| `Dot (m, s) -> Format.fprintf ppf "%a.%s" datatype_path m s
1136-
| `Constructor (p, t) ->
1137-
Format.fprintf ppf "%a.%s" resolved_datatype_path p
1138-
(Odoc_model.Names.ConstructorName.to_string t)
1139-
11401090
and resolved_class_type_path :
11411091
Format.formatter -> Cpath.Resolved.class_type -> unit =
11421092
fun ppf p ->
@@ -1210,10 +1160,6 @@ module Fmt = struct
12101160
Format.fprintf ppf "%a.%s" model_resolved_path
12111161
(parent :> t)
12121162
(Odoc_model.Names.TypeName.to_string name)
1213-
| `Constructor (parent, name) ->
1214-
Format.fprintf ppf "%a.%s" model_resolved_path
1215-
(parent :> t)
1216-
(Odoc_model.Names.ConstructorName.to_string name)
12171163
| `Value (parent, name) ->
12181164
Format.fprintf ppf "%a.%s" model_resolved_path
12191165
(parent :> t)
@@ -1248,11 +1194,6 @@ module Fmt = struct
12481194
(t1 :> t)
12491195
model_path
12501196
(t2 :> Odoc_model.Paths.Path.t)
1251-
| `CanonicalDataType (t1, t2) ->
1252-
Format.fprintf ppf "canonicaldaty(%a,%a)" model_resolved_path
1253-
(t1 :> t)
1254-
model_path
1255-
(t2 :> Odoc_model.Paths.Path.t)
12561197
| `Apply (funct, arg) ->
12571198
Format.fprintf ppf "%a(%a)" model_resolved_path
12581199
(funct :> t)
@@ -1864,19 +1805,6 @@ module Of_Lang = struct
18641805
| `ClassType (p, name) ->
18651806
`ClassType (`Module (resolved_module_path ident_map p), name)
18661807

1867-
and resolved_datatype_path :
1868-
_ -> Odoc_model.Paths.Path.Resolved.DataType.t -> Cpath.Resolved.datatype
1869-
=
1870-
fun ident_map p ->
1871-
match p with
1872-
| `Identifier i -> (
1873-
match identifier Maps.Type.find ident_map.types i with
1874-
| `Local l -> `Local l
1875-
| `Identifier _ -> `Gpath p)
1876-
| `CanonicalDataType (p1, p2) ->
1877-
`CanonicalDataType (resolved_datatype_path ident_map p1, p2)
1878-
| `Type (p, name) -> `Type (`Module (resolved_module_path ident_map p), name)
1879-
18801808
and resolved_value_path :
18811809
_ -> Odoc_model.Paths.Path.Resolved.Value.t -> Cpath.Resolved.value =
18821810
fun ident_map p ->
@@ -1885,13 +1813,6 @@ module Of_Lang = struct
18851813
`Value (`Module (resolved_module_path ident_map p), name)
18861814
| `Identifier _ -> `Gpath p
18871815

1888-
and resolved_constructor_path :
1889-
_ ->
1890-
Odoc_model.Paths.Path.Resolved.Constructor.t ->
1891-
Cpath.Resolved.constructor =
1892-
fun ident_map (`Constructor (p, name)) ->
1893-
`Constructor (resolved_datatype_path ident_map p, name)
1894-
18951816
and resolved_class_type_path :
18961817
_ ->
18971818
Odoc_model.Paths.Path.Resolved.ClassType.t ->
@@ -1944,30 +1865,13 @@ module Of_Lang = struct
19441865
| `Local i -> `Local (i, b))
19451866
| `Dot (path', x) -> `Dot (module_path ident_map path', x)
19461867

1947-
and datatype : _ -> Odoc_model.Paths.Path.DataType.t -> Cpath.datatype =
1948-
fun ident_map p ->
1949-
match p with
1950-
| `Resolved r -> `Resolved (resolved_datatype_path ident_map r)
1951-
| `Identifier (i, b) -> (
1952-
match identifier Maps.Type.find ident_map.types i with
1953-
| `Identifier i -> `Identifier (i, b)
1954-
| `Local i -> `Local (i, b))
1955-
| `Dot (path', x) -> `Dot (module_path ident_map path', x)
1956-
19571868
and value_path : _ -> Odoc_model.Paths.Path.Value.t -> Cpath.value =
19581869
fun ident_map p ->
19591870
match p with
19601871
| `Resolved r -> `Resolved (resolved_value_path ident_map r)
19611872
| `Dot (path', x) -> `Dot (module_path ident_map path', x)
19621873
| `Identifier (i, b) -> `Identifier (i, b)
19631874

1964-
and constructor_path :
1965-
_ -> Odoc_model.Paths.Path.Constructor.t -> Cpath.constructor =
1966-
fun ident_map p ->
1967-
match p with
1968-
| `Resolved r -> `Resolved (resolved_constructor_path ident_map r)
1969-
| `Dot (path', x) -> `Dot (datatype ident_map path', x)
1970-
19711875
and class_type_path :
19721876
_ -> Odoc_model.Paths.Path.ClassType.t -> Cpath.class_type =
19731877
fun ident_map p ->

src/xref2/component.mli

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,6 @@ module Fmt : sig
597597

598598
val value_path : Format.formatter -> Cpath.value -> unit
599599

600-
val constructor_path : Format.formatter -> Cpath.constructor -> unit
601-
602600
val resolved_class_type_path :
603601
Format.formatter -> Cpath.Resolved.class_type -> unit
604602

@@ -663,11 +661,6 @@ module Of_Lang : sig
663661
val resolved_value_path :
664662
map -> Odoc_model.Paths.Path.Resolved.Value.t -> Cpath.Resolved.value
665663

666-
val resolved_constructor_path :
667-
map ->
668-
Odoc_model.Paths.Path.Resolved.Constructor.t ->
669-
Cpath.Resolved.constructor
670-
671664
val resolved_class_type_path :
672665
map ->
673666
Odoc_model.Paths.Path.Resolved.ClassType.t ->
@@ -680,13 +673,8 @@ module Of_Lang : sig
680673

681674
val type_path : map -> Odoc_model.Paths.Path.Type.t -> Cpath.type_
682675

683-
val datatype : map -> Odoc_model.Paths.Path.DataType.t -> Cpath.datatype
684-
685676
val value_path : map -> Odoc_model.Paths.Path.Value.t -> Cpath.value
686677

687-
val constructor_path :
688-
map -> Odoc_model.Paths.Path.Constructor.t -> Cpath.constructor
689-
690678
val class_type_path :
691679
map -> Odoc_model.Paths.Path.ClassType.t -> Cpath.class_type
692680

src/xref2/cpath.ml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,6 @@ module rec Resolved : sig
3939
and value =
4040
[ `Value of parent * ValueName.t | `Gpath of Path.Resolved.Value.t ]
4141

42-
and datatype =
43-
[ `Local of Ident.path_datatype
44-
| `Gpath of Path.Resolved.DataType.t
45-
| `Substituted of datatype
46-
| `CanonicalDataType of datatype * Path.DataType.t
47-
| `Type of parent * TypeName.t ]
48-
49-
and constructor = [ `Constructor of datatype * ConstructorName.t ]
50-
5142
and class_type =
5243
[ `Local of Ident.path_class_type
5344
| `Substituted of class_type
@@ -93,19 +84,6 @@ and Cpath : sig
9384
| `Value of Resolved.parent * ValueName.t
9485
| `Identifier of Identifier.Value.t * bool ]
9586

96-
and datatype =
97-
[ `Resolved of Resolved.datatype
98-
| `Substituted of datatype
99-
| `Local of Ident.path_datatype * bool
100-
| `Identifier of Odoc_model.Paths.Identifier.Path.DataType.t * bool
101-
| `Dot of module_ * string
102-
| `Type of Resolved.parent * TypeName.t ]
103-
104-
and constructor =
105-
[ `Resolved of Resolved.constructor
106-
| `Dot of datatype * string
107-
| `Constructor of Resolved.datatype * ConstructorName.t ]
108-
10987
and class_type =
11088
[ `Resolved of Resolved.class_type
11189
| `Substituted of class_type

src/xref2/ident.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ type class_type = [ `LClassType of ClassTypeName.t * int ]
5353

5454
type path_type = [ type_ | class_ | class_type ]
5555

56-
type path_datatype = type_
57-
5856
type path_value = value
5957

6058
type path_class_type = [ class_ | class_type ]

src/xref2/lang_of.ml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,6 @@ module Path = struct
204204
| `Value (p, name) -> `Value (resolved_parent map p, name)
205205
| `Gpath y -> y
206206

207-
and resolved_datatype map (p : Cpath.Resolved.datatype) :
208-
Odoc_model.Paths.Path.Resolved.DataType.t =
209-
match p with
210-
| `Gpath y -> y
211-
| `Local id -> `Identifier (Component.TypeMap.find id map.type_)
212-
| `CanonicalDataType (t1, t2) ->
213-
`CanonicalDataType (resolved_datatype map t1, t2)
214-
| `Type (p, name) -> `Type (resolved_parent map p, name)
215-
| `Substituted s -> resolved_datatype map s
216-
217-
and resolved_constructor map
218-
(`Constructor (p, name) : Cpath.Resolved.constructor) :
219-
Odoc_model.Paths.Path.Resolved.Constructor.t =
220-
`Constructor (resolved_datatype map p, name)
221-
222207
and resolved_class_type map (p : Cpath.Resolved.class_type) :
223208
Odoc_model.Paths.Path.Resolved.ClassType.t =
224209
match p with

src/xref2/lang_of.mli

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,8 @@ module Path : sig
2929

3030
val resolved_type : maps -> Cpath.Resolved.type_ -> Path.Resolved.Type.t
3131

32-
val resolved_datatype :
33-
maps -> Cpath.Resolved.datatype -> Path.Resolved.DataType.t
34-
3532
val resolved_value : maps -> Cpath.Resolved.value -> Path.Resolved.Value.t
3633

37-
val resolved_constructor :
38-
maps -> Cpath.Resolved.constructor -> Path.Resolved.Constructor.t
39-
4034
val resolved_class_type :
4135
maps -> Cpath.Resolved.class_type -> Path.Resolved.ClassType.t
4236

0 commit comments

Comments
 (0)