diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2013-07-31 07:35:02 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2013-07-31 07:35:02 +0000 |
commit | 8e14ca9ee690bbd74ff111c93210204239b6fb95 (patch) | |
tree | 11933cb16fcbcdf5f03a86a70acaa2e535c38157 | |
parent | 501789fd2b7232c8e7966d430699841f29080280 (diff) |
put back trimming
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13955 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | experimental/garrigue/show_types.diff | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/experimental/garrigue/show_types.diff b/experimental/garrigue/show_types.diff index 42d04bf0f..dc56789c4 100644 --- a/experimental/garrigue/show_types.diff +++ b/experimental/garrigue/show_types.diff @@ -238,7 +238,7 @@ Index: toplevel/topdirs.ml let dir_untrace_all ppf () = List.iter -@@ -305,10 +306,55 @@ +@@ -305,10 +306,74 @@ !traced_functions; traced_functions := [] @@ -250,6 +250,25 @@ Index: toplevel/topdirs.ml +(* Typing information *) + ++let rec trim_modtype = function ++ Mty_signature _ -> Mty_signature [] ++ | Mty_functor (id, mty, mty') -> ++ Mty_functor (id, mty, trim_modtype mty') ++ | Mty_ident _ as mty -> mty ++ ++let trim_signature = function ++ Mty_signature sg -> ++ Mty_signature ++ (List.map ++ (function ++ Sig_module (id, mty, rs) -> ++ Sig_module (id, trim_modtype mty, rs) ++ (*| Sig_modtype (id, Modtype_manifest mty) -> ++ Sig_modtype (id, Modtype_manifest (trim_modtype mty))*) ++ | item -> item) ++ sg) ++ | mty -> mty ++ +let dir_show ppf kind {Location.loc; txt=lid} = + let env = !Toploop.toplevel_env in + try @@ -273,7 +292,7 @@ Index: toplevel/topdirs.ml + Sig_exception (id, {exn_args=desc.cstr_args; exn_loc=Location.none}) + | Pkind_module -> + let path, desc = Typetexp.find_module env loc lid in -+ Sig_module (id, desc, Trec_not) ++ Sig_module (id, trim_signature desc, Trec_not) + | Pkind_modtype -> + let path, desc = Typetexp.find_modtype env loc lid in + Sig_modtype (id, desc) @@ -294,7 +313,7 @@ Index: toplevel/topdirs.ml let _ = Hashtbl.add directive_table "trace" (Directive_ident (dir_trace std_out)); Hashtbl.add directive_table "untrace" (Directive_ident (dir_untrace std_out)); -@@ -337,4 +383,7 @@ +@@ -337,4 +402,7 @@ (Directive_string (parse_warnings std_out false)); Hashtbl.add directive_table "warn_error" |