From d7b09be593bd400737a53697e9b9c486782ab296 Mon Sep 17 00:00:00 2001 From: Nicolas PENELOUX Date: Mon, 13 Nov 2023 16:39:29 +0100 Subject: [PATCH] 72/72, fix for --- flap/src/hopix/hopixInterpreter.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flap/src/hopix/hopixInterpreter.ml b/flap/src/hopix/hopixInterpreter.ml index 20b46a2..7f25a5a 100644 --- a/flap/src/hopix/hopixInterpreter.ml +++ b/flap/src/hopix/hopixInterpreter.ml @@ -462,6 +462,7 @@ and case_value expr branches environment memory = | [] -> error [ expr.position ] "erreur" | _ as env -> List.hd env + and for_value id expr1 expr2 expr3 environment memory = let borne_inf = value_as_int (expression' environment memory expr1) in let borne_sup = value_as_int (expression' environment memory expr2) in @@ -481,7 +482,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' env' 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 *) @@ -605,7 +606,7 @@ and tagged_pattern cons1 cons2 pattern1 pattern2 environment = and record_pattern environment r r' = - (*) + match r with | [] -> Some environment | field :: reste -> @@ -625,7 +626,7 @@ and record_pattern environment r r' = | None -> record_labbel_pattern environment field reste else record_labbel_pattern environment field reste -*) + and literal_pattern pl environment expression = let valeur_literal = pl.value in