From 34c2a6c8e354b7bf419115bd7f324e29411b81e7 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 15 Dec 2023 19:27:03 +0100 Subject: [PATCH] todos --- flap/src/fopix/hobixToFopix.ml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flap/src/fopix/hobixToFopix.ml b/flap/src/fopix/hobixToFopix.ml index 59a4426..0a2ad77 100644 --- a/flap/src/fopix/hobixToFopix.ml +++ b/flap/src/fopix/hobixToFopix.ml @@ -122,7 +122,8 @@ let free_variables = in (* Une variable libre est une variable qui peut ĂȘtre substituĂ© *) - (* TODO : rajouter des explications pour While Define et Fun *) + (* 1.2 + TODO : rajouter des explications pour While Define et Fun *) let rec fvs = function | S.Literal _ -> M.empty | S.Variable x -> M.singleton x @@ -205,6 +206,8 @@ let translate (p : S.t) env = let fs, defs = define_recursive_functions fdefs in fs @ List.map (fun (x, e) -> T.DefineValue (x, e)) defs and define_recursive_functions rdefs = + (* 1.5 + TODO *) failwith "Students! This is your job (define_recursive_functions)!" and expression env = function | S.Literal l -> [], T.Literal (literal l) @@ -220,6 +223,7 @@ let translate (p : S.t) env = in [], xc | S.Define (vdef, a) -> + (* 1.3 (2) *) let afs, a = expression env a in (match vdef with | S.SimpleValue (id, b) -> @@ -227,8 +231,11 @@ let translate (p : S.t) env = afs @ bfs, T.Define (identifier id, a, b) | S.RecFunctions _ -> failwith "Students! This is your job (S.RecFunctions)!") | S.Apply (a, bs) -> + (* 1.3 (4) *) let afs, a = expression env a in let bsfs, bs = expressions env bs in + (* 1.4 + TODO *) afs @ bsfs, T.UnknownFunCall (a, bs) | S.IfThenElse (a, b, c) -> let afs, a = expression env a in @@ -236,6 +243,8 @@ let translate (p : S.t) env = let cfs, c = expression env c in afs @ bfs @ cfs, T.IfThenElse (a, b, c) | S.Fun (x, e) as f -> + (* 1.3 (3) + TODO: J'ai une boucle infini ici je comprends rien *) let fname = make_fresh_function_identifier () in let x = List.map identifier x in let efs, e = expression env e in