[c pass] idem

This commit is contained in:
Arnaud DABY-SEESARAM 2022-12-19 14:30:39 +01:00
parent 9483f7df5e
commit 01d4a08e8a

View File

@ -98,11 +98,20 @@ let rec merge_neighbour_ifs = function
| CIf (c, e1, e2) :: CIf (c', e'1, e'2) :: b -> | CIf (c, e1, e2) :: CIf (c', e'1, e'2) :: b ->
begin begin
if c = c' then if c = c' then
merge_neighbour_ifs (CIf (c, e1 @ e'1, e2 @ e'2) :: b) merge_neighbour_ifs
(CIf (c,
merge_neighbour_ifs (e1 @ e'1),
merge_neighbour_ifs (e2 @ e'2)) :: b)
else if c = CMonOp (MOp_not, c') then else if c = CMonOp (MOp_not, c') then
merge_neighbour_ifs (CIf (c, e1 @ e'2, e2 @ e'1) :: b) merge_neighbour_ifs
(CIf (c',
merge_neighbour_ifs (e2 @ e'1),
merge_neighbour_ifs (e1 @ e'2)) :: b)
else if c' = CMonOp (MOp_not, c) then else if c' = CMonOp (MOp_not, c) then
merge_neighbour_ifs (CIf (c, e1 @ e'2, e2 @ e'1) :: b) merge_neighbour_ifs
(CIf (c,
merge_neighbour_ifs (e1 @ e'2),
merge_neighbour_ifs (e2 @ e'1)) :: b)
else CIf (c, e1, e2) :: merge_neighbour_ifs (CIf (c', e'1, e'2) :: b) else CIf (c, e1, e2) :: merge_neighbour_ifs (CIf (c', e'1, e'2) :: b)
end end
| stmt :: stmt' :: b -> | stmt :: stmt' :: b ->