소스 검색

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
 			in
 			let new_if = { ae.a_expr with eexpr = TIf(econd.a_expr, eif, eelse) } in
 			let new_if = { ae.a_expr with eexpr = TIf(econd.a_expr, eif, eelse) } in
 			lift false econd.a_blocks new_if
 			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)) ->
 		| (true, TWhile(econd, ebody, NormalWhile)) ->
 			let econd = trans true [] econd in
 			let econd = trans true [] econd in
 			let ebody = to_expr (trans false [] ebody) in
 			let ebody = to_expr (trans false [] ebody) in