This commit is contained in:
Mylloon 2023-11-12 19:37:57 +01:00
parent 5f2c67b1b3
commit be75f1425b
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -484,7 +484,7 @@ and boucle_for id borne_inf borne_sup expr3 environment memory =
(* On lis l'identifier avec la borne inférieur *)
Environment.bind environment id.value (int_as_value borne_inf)
in
let calcul = expression' environment memory expr3 in
let _calcul = expression' environment memory expr3 in
boucle_for id (Mint.add borne_inf Mint.one) borne_sup expr3 env' memory)
else VUnit (* Cas où nous ne sommes plus dans la boucle, on renvoie un VUnit *)
@ -511,7 +511,7 @@ and while_value expr1 expr2 environment memory pos =
(* On récupère la valeur de la condition *)
match value_as_bool cond with
| true ->
let expr' = expression' environment memory expr2 in
let _expr = expression' environment memory expr2 in
expression pos environment memory (While (expr1, expr2))
| false -> VUnit
@ -538,12 +538,12 @@ and apply_expression f x environment memory =
| VPrimitive (_, f) ->
(* Fonction "primitive" *)
f memory x_val
| VClosure (_env_fn, _pattern, _expr) ->
let valeur_pattern = _pattern.value in
let pat = pattern _env_fn valeur_pattern x_val in
| VClosure (env_fn, pattern', expr) ->
let valeur_pattern = pattern'.value in
let pat = pattern env_fn valeur_pattern x_val in
(* Pattern va nous calculer un nouvelle environnement *)
(match pat with
| Some env' -> expression' env' memory _expr
| Some env' -> expression' env' memory expr
| None -> failwith "erreur")
| _ -> assert false (* By typing *)