From c922570d0f2066f8dbb059b79cc89d75174c2a85 Mon Sep 17 00:00:00 2001 From: Xavier Clerc Date: Mon, 9 Jul 2012 09:07:43 +0000 Subject: [PATCH] PR#5651: printer for abstract data type (camlp4 revised syntax) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12666 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- Changes | 1 + camlp4/Camlp4Top/Rprint.ml | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index aeac5fc87..2784d6449 100644 --- a/Changes +++ b/Changes @@ -158,6 +158,7 @@ Bug Fixes: - PR#5610: new unmarshaler (from PR#5318) fails to freshen object identifiers - PR#5620: invalid printing of type manifest (camlp4 revised syntax) - PR#5643: issues with .cfi and .loc directives generated by ocamlopt -g +- PR#5651: printer for abstract data type (camlp4 revised syntax) - PR#5661: fixes for the test suite - PR#5671: initialization of compare_ext field in caml_final_custom_operations() - problem with printing of string literals in camlp4 (reported on caml-list) diff --git a/camlp4/Camlp4Top/Rprint.ml b/camlp4/Camlp4Top/Rprint.ml index d913efcca..7f3b28f53 100644 --- a/camlp4/Camlp4Top/Rprint.ml +++ b/camlp4/Camlp4Top/Rprint.ml @@ -451,8 +451,13 @@ and print_out_type_decl kwd ppf (name, args, ty, priv, constraints) = print_kind ty2 | ty -> print_kind ppf ty ] in - fprintf ppf "@[<2>@[@[%s %t@] =%a@]%a@]" kwd type_defined - print_types ty print_constraints constraints + match ty with + [ Otyp_abstract -> + fprintf ppf "@[<2>@[@[%s %t@]@]%a@]" kwd type_defined + print_constraints constraints + | _ -> + fprintf ppf "@[<2>@[@[%s %t@] =%a@]%a@]" kwd type_defined + print_types ty print_constraints constraints ] ; (* Phrases *)