@@ -208,9 +208,6 @@ let constant f = function
208
208
let mutable_flag f = function
209
209
| Immutable -> ()
210
210
| Mutable -> pp f " mutable@;"
211
- let virtual_flag f = function
212
- | Concrete -> ()
213
- | Virtual -> pp f " virtual@;"
214
211
215
212
(* trailing space added *)
216
213
let rec_flag f rf =
@@ -233,14 +230,8 @@ let tyvar f str = pp f "'%s" str
233
230
let tyvar_loc f str = pp f " '%s" str.txt
234
231
let string_quot f x = pp f " `%s" x
235
232
236
- (* c ['a,'b] *)
237
- let rec class_params_def ctxt f = function
238
- | [] -> ()
239
- | l ->
240
- pp f " [%a] " (* space *)
241
- (list (type_param ctxt) ~sep: " ," ) l
242
233
243
- and type_with_label ctxt f (label , c ) =
234
+ let rec type_with_label ctxt f (label , c ) =
244
235
match label with
245
236
| Nolabel -> core_type1 ctxt f c (* otherwise parenthesize *)
246
237
| Labelled s -> pp f " %s:%a" s (core_type1 ctxt) c
@@ -797,76 +788,6 @@ and item_extension ctxt f (s, e) =
797
788
and exception_declaration ctxt f ext =
798
789
pp f " @[<hov2>exception@ %a@]" (extension_constructor ctxt) ext
799
790
800
- and class_signature ctxt f { pcsig_self = ct ; pcsig_fields = l ;_} =
801
- let class_type_field f x =
802
- match x.pctf_desc with
803
- | Pctf_inherit (ct ) ->
804
- pp f " @[<2>inherit@ %a@]%a" (class_type ctxt) ct
805
- (item_attributes ctxt) x.pctf_attributes
806
- | Pctf_val (s , mf , vf , ct ) ->
807
- pp f " @[<2>val @ %a%a%s@ :@ %a@]%a"
808
- mutable_flag mf virtual_flag vf s.txt (core_type ctxt) ct
809
- (item_attributes ctxt) x.pctf_attributes
810
- | Pctf_method (s , pf , vf , ct ) ->
811
- pp f " @[<2>method %a %a%s :@;%a@]%a"
812
- private_flag pf virtual_flag vf s.txt (core_type ctxt) ct
813
- (item_attributes ctxt) x.pctf_attributes
814
- | Pctf_constraint (ct1 , ct2 ) ->
815
- pp f " @[<2>constraint@ %a@ =@ %a@]%a"
816
- (core_type ctxt) ct1 (core_type ctxt) ct2
817
- (item_attributes ctxt) x.pctf_attributes
818
- | Pctf_attribute a -> floating_attribute ctxt f a
819
- | Pctf_extension e ->
820
- item_extension ctxt f e;
821
- item_attributes ctxt f x.pctf_attributes
822
- in
823
- pp f " @[<hv0>@[<hv2>object@[<1>%a@]@ %a@]@ end@]"
824
- (fun f -> function
825
- {ptyp_desc =Ptyp_any ; ptyp_attributes =[] ; _} -> ()
826
- | ct -> pp f " (%a)" (core_type ctxt) ct) ct
827
- (list class_type_field ~sep: " @;" ) l
828
-
829
- (* call [class_signature] called by [class_signature] *)
830
- and class_type ctxt f x =
831
- match x.pcty_desc with
832
- | Pcty_signature cs ->
833
- class_signature ctxt f cs;
834
- attributes ctxt f x.pcty_attributes
835
- | Pcty_constr (li , l ) ->
836
- pp f " %a%a%a"
837
- (fun f l -> match l with
838
- | [] -> ()
839
- | _ -> pp f " [%a]@ " (list (core_type ctxt) ~sep: " ," ) l) l
840
- longident_loc li
841
- (attributes ctxt) x.pcty_attributes
842
- | Pcty_arrow (l , co , cl ) ->
843
- pp f " @[<2>%a@;->@;%a@]" (* FIXME remove parens later *)
844
- (type_with_label ctxt) (l,co)
845
- (class_type ctxt) cl
846
- | Pcty_extension e ->
847
- extension ctxt f e;
848
- attributes ctxt f x.pcty_attributes
849
- | Pcty_open (ovf , lid , e ) ->
850
- pp f " @[<2>let open%s %a in@;%a@]" (override ovf) longident_loc lid
851
- (class_type ctxt) e
852
-
853
- (* [class type a = object end] *)
854
- and class_type_declaration_list ctxt f l =
855
- let class_type_declaration kwd f x =
856
- let { pci_params= ls; pci_name= { txt; _ }; _ } = x in
857
- pp f " @[<2>%s %a%a%s@ =@ %a@]%a" kwd
858
- virtual_flag x.pci_virt
859
- (class_params_def ctxt) ls txt
860
- (class_type ctxt) x.pci_expr
861
- (item_attributes ctxt) x.pci_attributes
862
- in
863
- match l with
864
- | [] -> ()
865
- | [x] -> class_type_declaration " class type" f x
866
- | x :: xs ->
867
- pp f " @[<v>%a@,%a@]"
868
- (class_type_declaration " class type" ) x
869
- (list ~sep: " @," (class_type_declaration " and" )) xs
870
791
871
792
and class_field ctxt f x =
872
793
match x.pcf_desc with
@@ -1023,7 +944,7 @@ and signature_item ctxt f x : unit =
1023
944
pp f " @ =@ %a" (module_type ctxt) mt
1024
945
) md
1025
946
(item_attributes ctxt) attrs
1026
- | Psig_class_type (l ) -> class_type_declaration_list ctxt f l
947
+ | Psig_class_type () -> ()
1027
948
| Psig_recmodule decls ->
1028
949
let rec string_x_module_type_list f ?(first =true ) l =
1029
950
match l with
@@ -1222,7 +1143,7 @@ and structure_item ctxt f x =
1222
1143
) md
1223
1144
(item_attributes ctxt) attrs
1224
1145
| Pstr_class () -> ()
1225
- | Pstr_class_type l -> class_type_declaration_list ctxt f l
1146
+ | Pstr_class_type () -> ()
1226
1147
| Pstr_primitive vd ->
1227
1148
pp f " @[<hov2>external@ %a@ :@ %a@]%a"
1228
1149
protect_ident vd.pval_name.txt
0 commit comments