Commit 8b2c480e authored by Julien Lopez's avatar Julien Lopez
Browse files

[TESTS][EVAL] Fix stupid mistake, eval on simple let expr works

parent 1dd60588
......@@ -66,13 +66,8 @@ let parse_to_lambda expr =
| Match(_, e, branches) ->
Match(_parse_to_lambda env e, compile_branches env branches)
| Let(_, x, e1, e2) -> (* TODO: Define the "_" *)
let map = Hashtbl.create page_size in
Hashtbl.add map "_" 0;
Hashtbl.add map x 1;
let new_env = mk_env ~parent:(Some env) ~max_size:env.max_size ~map:map
2 (env.global_size + 2) in
let newloc = Camlp4.PreCast.Loc.ghost in
Apply(_parse_to_lambda new_env (Abstract(newloc, "_", [x], e2)),
Apply(_parse_to_lambda env (Abstract(newloc, "_", [x], e2)),
_parse_to_lambda env e1)
(* TODO: Fix this function *)
......
......@@ -49,4 +49,4 @@ with
let cend = Loc.stop_off loc - Loc.start_bol loc in
eprintf "File %s, line %d, characters %d-%d:\n" (Loc.file_name loc) l
cbegin cend; raise exn
| _ -> exit 4
| e -> eprintf "Runtime error.\n"; raise e
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