fix compilation with ocaml < 4.01

This commit is contained in:
Jeremie Dimino 2013-08-08 11:50:17 -04:00
parent 7a3459f511
commit 5e99e350c2
1 changed files with 6 additions and 0 deletions

View File

@ -745,7 +745,9 @@ module Emacs(M : sig end) = struct
(* Rewrite toplevel expressions. *)
let phrase = rewrite phrase in
try
#if ocaml_version > (4, 00, 1)
Env.reset_cache_toplevel ();
#endif
ignore (Toploop.execute_phrase true Format.std_formatter phrase);
true
with exn ->
@ -930,6 +932,8 @@ end
| Extra macros |
+-----------------------------------------------------------------+ *)
#if ocaml_version > (4, 00, 1)
let typeof id =
let env = !Toploop.toplevel_env in
match try Some (Env.lookup_type id env) with Not_found -> None with
@ -954,6 +958,8 @@ let () =
Hashtbl.add Toploop.directive_table "typeof"
(Toploop.Directive_ident typeof)
#endif
(* +-----------------------------------------------------------------+
| Entry point |
+-----------------------------------------------------------------+ *)