소스 검색

deactivate TPatMatch in interp-mode

Simon Krajewski 12 년 전
부모
커밋
f260c238c5
2개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 0 1
      genneko.ml
  2. 1 1
      typer.ml

+ 0 - 1
genneko.ml

@@ -421,7 +421,6 @@ and gen_expr ctx e =
 				],p)
 		)
 	| TPatMatch dt ->
-		(* if e.epos.pfile = "Main.hx" then Array.iteri (fun i dt -> print_endline (string_of_int i); print_endline (s_dt "" dt)) dt.dt_dt_lookup; *)
 		let num_labels = Array.length dt.dt_dt_lookup in
 		let lc = ctx.label_count in
 		ctx.label_count <- ctx.label_count + num_labels + 1;

+ 1 - 1
typer.ml

@@ -2079,7 +2079,7 @@ and type_switch ctx e cases def (with_type:with_type) p =
 	try
 		if (Common.defined ctx.com Common.Define.NoPatternMatching) then raise Exit;
 		let dt = match_expr ctx e cases def with_type p in
-		if not ctx.in_macro && ctx.com.config.pf_pattern_matching then mk (TPatMatch dt) dt.dt_type p else Codegen.PatternMatchConversion.to_typed_ast ctx dt p
+		if not ctx.in_macro && not (Common.defined ctx.com Define.Interp) && ctx.com.config.pf_pattern_matching then mk (TPatMatch dt) dt.dt_type p else Codegen.PatternMatchConversion.to_typed_ast ctx dt p
 	with Exit ->
 		type_switch_old ctx e cases def with_type p