From d5f72c278c14d1cd2db58a2b64dff7856120c2ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20G=C3=A9rard?= Date: Mon, 28 Nov 2011 00:45:45 +0100 Subject: [PATCH] mls2obc bug fix y = (if then else) when c ou bien y = f() when c ne compilait pas. --- compiler/main/mls2obc.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/main/mls2obc.ml b/compiler/main/mls2obc.ml index 06e3c19..823dc42 100644 --- a/compiler/main/mls2obc.ml +++ b/compiler/main/mls2obc.ml @@ -434,10 +434,13 @@ let empty_call_context = None [j] obj decs [s] the actions used in the step method. [v] var decs *) -let rec translate_eq map call_context { Minils.eq_lhs = pat; Minils.eq_rhs = e } +let rec translate_eq map call_context ({ Minils.eq_lhs = pat; Minils.eq_rhs = e } as eq) (v, si, j, s) = let { Minils.e_desc = desc; Minils.e_base_ck = ck; Minils.e_loc = loc } = e in match (pat, desc) with + | pat, Minils.Ewhen (e,_,_) -> + translate_eq map call_context {eq with Minils.eq_rhs = e} (v, si, j, s) + (* TODO Efby and Eifthenelse should be dealt with in translate_act, no ? *) | Minils.Evarpat n, Minils.Efby (opt_c, e) -> let x = var_from_name map n in let si = (match opt_c with