Commit 1f1b3355 authored by Pietro Abate's avatar Pietro Abate

[r2006-02-14 10:42:36 by afrisch] eval can now be called several times and use...

[r2006-02-14 10:42:36 by afrisch] eval can now be called several times and use the toplevel environment

Original author: afrisch
Date: 2006-02-14 10:45:18+00:00
parent fb2d9bfb
......@@ -279,14 +279,16 @@ let show ppf id t v =
print_norm t
print_value_opt v
let phrases ppf phs =
let (tenv,cenv,_) =
Compile.comp_unit
~run:true ~show:(show ppf)
~directive:(directive ppf)
let ev_top ~run ~show ?directive phs =
let (tenv,cenv,_) =
Compile.comp_unit ~run ~show ?directive
!typing_env !compile_env phs in
typing_env := tenv;
compile_env := cenv
let phrases ppf phs =
ev_top ~run:true ~show:(show ppf) ~directive:(directive ppf) phs
let catch_exn ppf_err exn =
if not catch_exceptions then raise exn;
......@@ -361,8 +363,7 @@ let eval s =
vals := (None,v) :: !vals
| _ -> assert false
in
ignore (Compile.comp_unit
~run:true ~show Builtin.env Compile.empty_toplevel phs);
ev_top ~run:true ~show phs;
List.rev !vals
let eval s =
......
......@@ -20,3 +20,5 @@ val eval_unit: Value.t array -> code_item list -> unit
val eval_apply: Value.t -> Value.t -> Value.t
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment