|
@@ -628,7 +628,9 @@ module Fusion = struct
|
|
e2,el
|
|
e2,el
|
|
in
|
|
in
|
|
if !found then e else match e.eexpr with
|
|
if !found then e else match e.eexpr with
|
|
- | TWhile _ | TFunction _ ->
|
|
|
|
|
|
+ | TWhile _ | TTry _ ->
|
|
|
|
+ raise Exit
|
|
|
|
+ | TFunction _ ->
|
|
e
|
|
e
|
|
| TIf(e1,e2,eo) ->
|
|
| TIf(e1,e2,eo) ->
|
|
let e1 = replace e1 in
|
|
let e1 = replace e1 in
|
|
@@ -641,6 +643,7 @@ module Fusion = struct
|
|
| Lua | Python -> explore e1
|
|
| Lua | Python -> explore e1
|
|
| _ -> replace e1
|
|
| _ -> replace e1
|
|
in
|
|
in
|
|
|
|
+ if not !found then raise Exit;
|
|
{e with eexpr = TSwitch(e1,cases,edef)}
|
|
{e with eexpr = TSwitch(e1,cases,edef)}
|
|
| TLocal v2 when v1 == v2 && not !blocked ->
|
|
| TLocal v2 when v1 == v2 && not !blocked ->
|
|
found := true;
|
|
found := true;
|
|
@@ -717,10 +720,7 @@ module Fusion = struct
|
|
| e :: el ->
|
|
| e :: el ->
|
|
let e = replace e in
|
|
let e = replace e in
|
|
if !found then (List.rev (e :: acc)) @ el
|
|
if !found then (List.rev (e :: acc)) @ el
|
|
- else begin match e.eexpr with
|
|
|
|
- | TWhile _ | TIf _ | TSwitch _ | TTry _ -> raise Exit
|
|
|
|
- | _ -> loop (e :: acc) el
|
|
|
|
- end
|
|
|
|
|
|
+ else loop (e :: acc) el
|
|
| [] ->
|
|
| [] ->
|
|
List.rev acc
|
|
List.rev acc
|
|
in
|
|
in
|