This commit is contained in:
Mylloon 2023-12-15 14:06:55 +01:00
parent 22b0811cbe
commit 939d015453
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -235,7 +235,12 @@ let translate (p : S.t) env =
let bfs, b = expression env b in let bfs, b = expression env b in
let cfs, c = expression env c in let cfs, c = expression env c in
afs @ bfs @ cfs, T.IfThenElse (a, b, c) afs @ bfs @ cfs, T.IfThenElse (a, b, c)
| S.Fun (x, e) -> failwith "Students! This is your job (S.Fun)!" | S.Fun (x, e) ->
let fname = make_fresh_function_identifier () in
let x = List.map identifier x in
let efs, e = expression env e in
failwith "Students! This is your job (S.Fun)!"
(* efs, T.DefineFunction (fname, x, e) *)
| S.AllocateBlock a -> | S.AllocateBlock a ->
let afs, a = expression env a in let afs, a = expression env a in
afs, allocate_block a afs, allocate_block a