Fix printing of GADTs by Camlp4 with original syntax

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11321 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Jérémie Dimino 2011-12-16 20:33:18 +00:00
parent b50f1df8ff
commit ac3d343a25
1 changed files with 6 additions and 1 deletions

View File

@ -371,7 +371,12 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
match Ast.list_of_ctyp t [] with match Ast.list_of_ctyp t [] with
[ [] -> () [ [] -> ()
| ts -> | ts ->
pp f "@[<hv0>| %a@]" (list o#ctyp "@ | ") ts ]; pp f "@[<hv0>| %a@]" (list o#constructor_declaration "@ | ") ts ];
method private constructor_declaration f t =
match t with
[ <:ctyp< $t1$ : $t2$ -> $t3$ >> -> pp f "@[<2>%a :@ @[<2>%a@ ->@ %a@]@]" o#ctyp t1 o#constructor_type t2 o#ctyp t3
| t -> o#ctyp f t ];
method string f = pp f "%s"; method string f = pp f "%s";
method quoted_string f = pp f "%S"; method quoted_string f = pp f "%S";