Fix printing of type delcs that use 'private' keyword
type t = private A | B type u = t = private A | B Was previously printed out as: type t = private A | B type u = private t = A | Bmaster
parent
8dcb6877c7
commit
7543d73d83
|
@ -1250,7 +1250,11 @@ class printer ()= object(self:'self)
|
||||||
let manifest f =
|
let manifest f =
|
||||||
match x.ptype_manifest with
|
match x.ptype_manifest with
|
||||||
| None -> ()
|
| None -> ()
|
||||||
| Some y -> pp f "@;%a" self#core_type y
|
| Some y ->
|
||||||
|
if x.ptype_kind = Ptype_abstract then
|
||||||
|
pp f "%t@;%a" priv self#core_type y
|
||||||
|
else
|
||||||
|
pp f "@;%a" self#core_type y
|
||||||
in
|
in
|
||||||
let constructor_declaration f pcd =
|
let constructor_declaration f pcd =
|
||||||
pp f "|@;";
|
pp f "|@;";
|
||||||
|
@ -1264,12 +1268,12 @@ class printer ()= object(self:'self)
|
||||||
in
|
in
|
||||||
match x.ptype_kind with
|
match x.ptype_kind with
|
||||||
| Ptype_variant xs ->
|
| Ptype_variant xs ->
|
||||||
pp f "%t@\n%a" intro
|
pp f "%t%t@\n%a" intro priv
|
||||||
(self#list ~sep:"@\n" constructor_declaration) xs
|
(self#list ~sep:"@\n" constructor_declaration) xs
|
||||||
| Ptype_abstract -> ()
|
| Ptype_abstract -> ()
|
||||||
| Ptype_record l ->
|
| Ptype_record l ->
|
||||||
pp f "%t@;%a" intro self#record_declaration l
|
pp f "%t%t@;%a" intro priv self#record_declaration l
|
||||||
| Ptype_open -> pp f "%t@;.." intro
|
| Ptype_open -> pp f "%t%t@;.." intro priv
|
||||||
in
|
in
|
||||||
let constraints f =
|
let constraints f =
|
||||||
List.iter
|
List.iter
|
||||||
|
@ -1278,7 +1282,7 @@ class printer ()= object(self:'self)
|
||||||
self#core_type ct1 self#core_type ct2)
|
self#core_type ct1 self#core_type ct2)
|
||||||
x.ptype_cstrs
|
x.ptype_cstrs
|
||||||
in
|
in
|
||||||
pp f "%t%t%t%t" priv manifest repr constraints
|
pp f "%t%t%t" manifest repr constraints
|
||||||
|
|
||||||
method type_extension f x =
|
method type_extension f x =
|
||||||
let extension_constructor f x =
|
let extension_constructor f x =
|
||||||
|
|
Loading…
Reference in New Issue