summaryrefslogtreecommitdiff
path: root/toplevel
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2013-07-16 13:34:30 +0000
committerAlain Frisch <alain@frisch.fr>2013-07-16 13:34:30 +0000
commit525ef9d7035faa15f872af802f2998cd696977e2 (patch)
tree5cb30917030b0a391f87b9b10f8a02ecd55a6575 /toplevel
parentc92858209261d1736a046485b682f20ec459c14b (diff)
parent7334bb026a0d75d53e077cd400d44019f688c7e6 (diff)
downloadocaml-525ef9d7035faa15f872af802f2998cd696977e2.tar.gz
Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/opttoploop.ml8
-rw-r--r--toplevel/opttopmain.ml3
-rw-r--r--toplevel/toploop.ml12
-rw-r--r--toplevel/topmain.ml5
4 files changed, 17 insertions, 11 deletions
diff --git a/toplevel/opttoploop.ml b/toplevel/opttoploop.ml
index cc1dcf1c94..e547bbd4d6 100644
--- a/toplevel/opttoploop.ml
+++ b/toplevel/opttoploop.ml
@@ -382,7 +382,7 @@ let refill_lexbuf buffer len =
let _ =
Sys.interactive := true;
Dynlink.init ();
- Optcompile.init_path();
+ Compmisc.init_path true;
Clflags.dlcode := true;
()
@@ -407,7 +407,7 @@ let set_paths () =
()
let initialize_toplevel_env () =
- toplevel_env := Optcompile.initial_env()
+ toplevel_env := Compmisc.initial_env()
(* The interactive loop *)
@@ -447,7 +447,7 @@ let run_script ppf name args =
Array.blit args 0 Sys.argv 0 len;
Obj.truncate (Obj.repr Sys.argv) len;
Arg.current := 0;
- Optcompile.init_path();
- toplevel_env := Optcompile.initial_env();
+ Compmisc.init_path true;
+ toplevel_env := Compmisc.initial_env();
Sys.interactive := false;
use_silently ppf name
diff --git a/toplevel/opttopmain.ml b/toplevel/opttopmain.ml
index 0217709bc8..968014c2db 100644
--- a/toplevel/opttopmain.ml
+++ b/toplevel/opttopmain.ml
@@ -74,7 +74,7 @@ module Options = Main_args.Make_opttop_options (struct
let _noprompt = set noprompt
let _nopromptcont = set nopromptcont
let _nostdlib = set no_std_include
- let _ppx s = ppx := s :: !ppx
+ let _ppx s = Compenv.first_ppx := s :: !Compenv.first_ppx
let _principal = set principal
let _real_paths = set real_paths
let _rectypes = set recursive_types
@@ -87,6 +87,7 @@ module Options = Main_args.Make_opttop_options (struct
let _w s = Warnings.parse_options false s
let _warn_error s = Warnings.parse_options true s
let _warn_help = Warnings.help_warnings
+ let _short_paths = clear real_paths
let _dsource = set dump_source
let _dparsetree = set dump_parsetree
diff --git a/toplevel/toploop.ml b/toplevel/toploop.ml
index a8d1568bbe..e0a626f521 100644
--- a/toplevel/toploop.ml
+++ b/toplevel/toploop.ml
@@ -166,7 +166,9 @@ let load_lambda ppf lam =
(* Print the outcome of an evaluation *)
-let rec pr_item env = function
+let rec pr_item env items =
+ Printtyp.hide_rec_items items;
+ match items with
| Sig_value(id, decl) :: rem ->
let tree = Printtyp.tree_of_value_description id decl in
let valopt =
@@ -409,7 +411,7 @@ let refill_lexbuf buffer len =
let _ =
Sys.interactive := true;
let crc_intfs = Symtable.init_toplevel() in
- Compile.init_path();
+ Compmisc.init_path false;
List.iter
(fun (name, crc) ->
Consistbl.set Env.crc_units name crc Sys.executable_name)
@@ -436,7 +438,7 @@ let set_paths () =
Dll.add_path !load_path
let initialize_toplevel_env () =
- toplevel_env := Compile.initial_env()
+ toplevel_env := Compmisc.initial_env()
(* The interactive loop *)
@@ -476,7 +478,7 @@ let run_script ppf name args =
Array.blit args 0 Sys.argv 0 len;
Obj.truncate (Obj.repr Sys.argv) len;
Arg.current := 0;
- Compile.init_path();
- toplevel_env := Compile.initial_env();
+ Compmisc.init_path false;
+ toplevel_env := Compmisc.initial_env();
Sys.interactive := false;
use_silently ppf name
diff --git a/toplevel/topmain.ml b/toplevel/topmain.ml
index 4ce1ad87be..4c603cd3bf 100644
--- a/toplevel/topmain.ml
+++ b/toplevel/topmain.ml
@@ -11,6 +11,7 @@
(***********************************************************************)
open Clflags
+open Compenv
let usage = "Usage: ocaml <options> <object-files> [script-file [arguments]]\n\
options are:"
@@ -71,7 +72,7 @@ module Options = Main_args.Make_bytetop_options (struct
let _noprompt = set noprompt
let _nopromptcont = set nopromptcont
let _nostdlib = set no_std_include
- let _ppx s = ppx := s :: !ppx
+ let _ppx s = first_ppx := s :: !first_ppx
let _principal = set principal
let _short_paths = clear real_paths
let _rectypes = set recursive_types
@@ -95,6 +96,8 @@ end);;
let main () =
+ Compenv.readenv Before_args;
Arg.parse Options.list file_argument usage;
+ Compenv.readenv Before_link;
if not (prepare Format.err_formatter) then exit 2;
Toploop.loop Format.std_formatter