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