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);
|
Logs.set_level (Some Logs.Debug);
|
||||||
|
|
||||||
try
|
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);
|
Logs.debug (fun m -> m "[AST] %a" Ast.pp_modl ast);
|
||||||
let prog = compile ast in
|
let prog = compile ast in
|
||||||
Logs.debug (fun m -> Code.dump (m "[BC] %s") prog.main);
|
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 self = new_id () in
|
||||||
let env =
|
let env = Env.Obj { self; elems = List.map fst lib } in
|
||||||
(* TODO: lib entries *)
|
|
||||||
let _ = lib in
|
|
||||||
Env.Empty
|
|
||||||
in
|
|
||||||
let args = [] in
|
let args = [] in
|
||||||
let body = lower_block env modl.items in
|
let body = lower_block env modl.items in
|
||||||
{ self; args; body }
|
{ self; args; body }
|
||||||
|
|
Loading…
Reference in New Issue