From 8fc1729f47aa68868fdc85950484dfa5616d8155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Thu, 14 Mar 2019 19:30:55 +0100 Subject: [PATCH] If simplified to match --- AST2.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/AST2.ml b/AST2.ml index 55c268c53..86381a293 100644 --- a/AST2.ml +++ b/AST2.ml @@ -405,7 +405,14 @@ and s_instruction : I.instruction -> O.instr list = function and s_conditional I.{kwd_if;test;kwd_then;ifso;kwd_else;ifnot} : O.instr = let () = ignore (kwd_if,kwd_then,kwd_else) in - If { condition = s_expr test; ifso = s_instruction ifso; ifnot = s_instruction ifnot; orig = `TODO } + let test = s_expr test in + let ifso = O.PTrue, s_instruction ifso in + let ifnot = O.PFalse, s_instruction ifnot in + Match { + expr = test; + cases = [ifso; ifnot]; + orig = `TODO + } and s_match_instr I.{kwd_match;expr;kwd_with;lead_vbar;cases;kwd_end} : O.instr = let {value=cases;region} = cases in