ソースを参照

add missing TWhile case

Simon Krajewski 11 年 前
コミット
dfac003a9e
1 ファイル変更5 行追加0 行削除
  1. 5 0
      genpy.ml

+ 5 - 0
genpy.ml

@@ -658,6 +658,11 @@ module Transformer = struct
 			in
 			let new_if = { ae.a_expr with eexpr = TIf(econd.a_expr, eif, eelse) } in
 			lift false econd.a_blocks new_if
+		| (false, TWhile(econd, e1, NormalWhile)) ->
+			let econd1 = transform_expr econd ~is_value:true ~next_id:(Some ae.a_next_id) in
+			let e11 = to_expr (transform_expr e1 ~is_value:false ~next_id:(Some ae.a_next_id)) in
+			let new_while = mk (TWhile(econd1.a_expr,e11,NormalWhile)) ae.a_expr.etype ae.a_expr.epos in
+			lift_expr new_while ~is_value:false ~next_id:(Some ae.a_next_id) ~blocks:econd1.a_blocks
 		| (true, TWhile(econd, ebody, NormalWhile)) ->
 			let econd = trans true [] econd in
 			let ebody = to_expr (trans false [] ebody) in