summaryrefslogtreecommitdiff
path: root/camlp4/Camlp4Top
diff options
context:
space:
mode:
authorJacques Le Normand <rathereasy@gmail.com>2010-10-01 02:46:07 +0000
committerJacques Le Normand <rathereasy@gmail.com>2010-10-01 02:46:07 +0000
commit7af69814acf4e0b3bb0c9be5adf5bee71809db86 (patch)
tree31f9b1a48ba6a5d4da606500990abfdf7655bfbf /camlp4/Camlp4Top
parent7fa09d99e375dfc906f2b22063508a33124e4ec1 (diff)
downloadocaml-7af69814acf4e0b3bb0c9be5adf5bee71809db86.tar.gz
camlp4 now updated, but completely untested. I reverted camlp4 back to revision 10660 and then changed it from there
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadts@10697 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'camlp4/Camlp4Top')
-rw-r--r--camlp4/Camlp4Top/Rprint.ml14
1 files changed, 9 insertions, 5 deletions
diff --git a/camlp4/Camlp4Top/Rprint.ml b/camlp4/Camlp4Top/Rprint.ml
index c3d26319cd..6d1adac075 100644
--- a/camlp4/Camlp4Top/Rprint.ml
+++ b/camlp4/Camlp4Top/Rprint.ml
@@ -234,10 +234,14 @@ and print_simple_out_type ppf =
fprintf ppf "@[<1>(%a)@]" print_out_type ty ]
in
print_tkind ppf
-and print_out_constr ppf (name, tyl,_) = (* GAH : so wrong *)
- match tyl with
- [ [] -> fprintf ppf "%s" name
- | _ ->
+and print_out_constr ppf (name, tyl, ret) =
+ match (tyl,ret) with
+ [ ([], None) -> fprintf ppf "%s" name
+ | ([], Some r) -> fprintf ppf "@[<2>%s:@ %a@]" name print_out_type r
+ | (_,Some r) ->
+ fprintf ppf "@[<2>%s:@ %a -> %a@]" name
+ (print_typlist print_out_type " and") tyl print_out_type r
+ | (_,None) ->
fprintf ppf "@[<2>%s of@ %a@]" name
(print_typlist print_out_type " and") tyl ]
and print_out_label ppf (name, mut, arg) =
@@ -368,7 +372,7 @@ and print_out_sig_item ppf =
(if vir_flag then " virtual" else "") print_out_class_params params
name Toploop.print_out_class_type.val clt
| Osig_exception id tyl ->
- fprintf ppf "@[<2>exception %a@]" print_out_constr (id, tyl, None)
+ fprintf ppf "@[<2>exception %a@]" print_out_constr (id, tyl,None)
| Osig_modtype name Omty_abstract ->
fprintf ppf "@[<2>module type %s@]" name
| Osig_modtype name mty ->