summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1998-04-14 14:48:08 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1998-04-14 14:48:08 +0000
commit2d4b4b54ac39ea3323fb30300696bc77645f3932 (patch)
treedd8e4d073f7ef1c6827981346c17bd0e3fe32808
parentc3bb497dd8079e063ef4ca0477d55a8e8f998064 (diff)
Imprimer type t = ... and s = ...
(C'est pas encore parfait, mais mieux que l'ancienne impl) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1919 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--typing/printtyp.ml15
1 files changed, 12 insertions, 3 deletions
diff --git a/typing/printtyp.ml b/typing/printtyp.ml
index 4d6a91d16..462920ff5 100644
--- a/typing/printtyp.ml
+++ b/typing/printtyp.ml
@@ -305,7 +305,7 @@ let constrain ty =
close_box()
end
-let rec type_declaration id decl =
+let rec type_decl kwd id decl =
reset();
let params = List.map repr decl.type_params in
@@ -328,7 +328,7 @@ let rec type_declaration id decl =
end;
open_hvbox 2;
- print_string "type ";
+ print_string kwd;
type_expr {desc = Tconstr(Pident id, params, ref Mnil);
level = generic_level};
begin match decl.type_manifest with
@@ -373,6 +373,8 @@ and label (name, mut, arg) =
print_string ": ";
type_expr arg
+let type_declaration id decl = type_decl "type " id decl
+
(* Print an exception declaration *)
let exception_declaration id decl =
@@ -512,7 +514,14 @@ and signature_body spc = function
Tsig_value(id, decl) ->
value_description id decl; rem
| Tsig_type(id, decl) ->
- type_declaration id decl; rem
+ type_declaration id decl;
+ let rec more_type_declarations = function
+ Tsig_type(id, decl) :: rem ->
+ print_space();
+ type_decl "and " id decl;
+ more_type_declarations rem
+ | rem -> rem in
+ more_type_declarations rem
| Tsig_exception(id, decl) ->
exception_declaration id decl; rem
| Tsig_module(id, mty) ->