restore support for stdlib functions

This commit is contained in:
tali 2023-12-13 17:27:06 -05:00
parent 884570598c
commit 6837ee414f
2 changed files with 2 additions and 6 deletions

View File

@ -5,7 +5,7 @@ let () =
Logs.set_level (Some Logs.Debug);
try
let ast = parse "fun twice(x) x*2 val r = twice(5)" in
let ast = parse "fun twice(x) x*2 val r = min(5, twice(2))" in
Logs.debug (fun m -> m "[AST] %a" Ast.pp_modl ast);
let prog = compile ast in
Logs.debug (fun m -> Code.dump (m "[BC] %s") prog.main);

View File

@ -228,11 +228,7 @@ let lower ~lib (modl : Ast.modl) =
let self = new_id () in
let env =
(* TODO: lib entries *)
let _ = lib in
Env.Empty
in
let env = Env.Obj { self; elems = List.map fst lib } in
let args = [] in
let body = lower_block env modl.items in
{ self; args; body }