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. *)
|
||||
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 |
|
||||
+-----------------------------------------------------------------+ *)
|
||||
|
|
Loading…
Reference in New Issue