소스 검색

allowed Ctrl+C to break macros loops

Nicolas Cannasse 14 년 전
부모
커밋
879c949026
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      interp.ml
  2. 1 0
      main.ml

+ 1 - 1
interp.ml

@@ -1681,7 +1681,7 @@ let rec eval ctx (e,p) =
 			| _ ->
 				VNull
 		in
-		loop()
+		(try loop() with Sys.Break -> throw ctx p "Ctrl+C")
 	| EWhile (econd,e,DoWhile) ->
 		let rec loop() =
 			let v = (try

+ 1 - 0
main.ml

@@ -684,6 +684,7 @@ with
 
 ;;
 let all = Common.timer "other" in
+Sys.catch_break true;
 process_params [] (List.tl (Array.to_list Sys.argv));
 all();
 if !measure_times then begin