fmt
This commit is contained in:
parent
5f2c67b1b3
commit
be75f1425b
1 changed files with 6 additions and 6 deletions
|
@ -484,7 +484,7 @@ and boucle_for id borne_inf borne_sup expr3 environment memory =
|
||||||
(* On lis l'identifier avec la borne inférieur *)
|
(* On lis l'identifier avec la borne inférieur *)
|
||||||
Environment.bind environment id.value (int_as_value borne_inf)
|
Environment.bind environment id.value (int_as_value borne_inf)
|
||||||
in
|
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)
|
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 *)
|
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 *)
|
(* On récupère la valeur de la condition *)
|
||||||
match value_as_bool cond with
|
match value_as_bool cond with
|
||||||
| true ->
|
| true ->
|
||||||
let expr' = expression' environment memory expr2 in
|
let _expr = expression' environment memory expr2 in
|
||||||
expression pos environment memory (While (expr1, expr2))
|
expression pos environment memory (While (expr1, expr2))
|
||||||
| false -> VUnit
|
| false -> VUnit
|
||||||
|
|
||||||
|
@ -538,12 +538,12 @@ and apply_expression f x environment memory =
|
||||||
| VPrimitive (_, f) ->
|
| VPrimitive (_, f) ->
|
||||||
(* Fonction "primitive" *)
|
(* Fonction "primitive" *)
|
||||||
f memory x_val
|
f memory x_val
|
||||||
| VClosure (_env_fn, _pattern, _expr) ->
|
| VClosure (env_fn, pattern', expr) ->
|
||||||
let valeur_pattern = _pattern.value in
|
let valeur_pattern = pattern'.value in
|
||||||
let pat = pattern _env_fn valeur_pattern x_val in
|
let pat = pattern env_fn valeur_pattern x_val in
|
||||||
(* Pattern va nous calculer un nouvelle environnement *)
|
(* Pattern va nous calculer un nouvelle environnement *)
|
||||||
(match pat with
|
(match pat with
|
||||||
| Some env' -> expression' env' memory _expr
|
| Some env' -> expression' env' memory expr
|
||||||
| None -> failwith "erreur")
|
| None -> failwith "erreur")
|
||||||
| _ -> assert false (* By typing *)
|
| _ -> assert false (* By typing *)
|
||||||
|
|
||||||
|
|
Reference in a new issue