restore support for stdlib functions
This commit is contained in:
parent
884570598c
commit
6837ee414f
|
@ -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);
|
||||
|
|
|
@ -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 }
|
||||
|
|
Loading…
Reference in New Issue