Commit cd3c3d8c authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-02-09 20:33:20 by afrisch] Empty log message

Original author: afrisch
Date: 2004-02-09 20:34:05+00:00
parent b2030041
......@@ -298,16 +298,26 @@ let eval_rec_funs funs =
assert (!frame = 0);
List.iter (fun e -> push (eval [||] e)) funs
let expr e =
let protect_eval f x =
assert (!frame = 0);
match e with
let old_sp = !sp in
try f x
with exn -> frame := 0; sp := old_sp; raise exn
let expr =
protect_eval
(function
| Eval e -> eval [||] e
| _-> assert false
)
let eval = function
let eval =
protect_eval
(function
| Eval e -> eval_expr e
| Let_decl (p,e) -> eval_let_decl p e
| Let_funs funs -> eval_rec_funs funs
)
let comp_unit init code =
......
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