Przeglądaj źródła

remove roundtrip

Simon Krajewski 1 rok temu
rodzic
commit
ad161fc15c

+ 23 - 34
src/compiler/compiler.ml

@@ -434,7 +434,7 @@ with
 		error ctx ("Error: No completion point was found") null_pos
 	| DisplayException.DisplayException dex ->
 		DisplayOutput.handle_display_exception ctx dex
-	| Out_of_memory | EvalTypes.Sys_exit _ | Hlinterp.Sys_exit _ | DisplayProcessingGlobals.Completion _ | ServerCompilationContext.HxbRoundtrip as exc ->
+	| Out_of_memory | EvalTypes.Sys_exit _ | Hlinterp.Sys_exit _ | DisplayProcessingGlobals.Completion _ as exc ->
 		(* We don't want these to be caught by the catchall below *)
 		raise exc
 	| e when (try Sys.getenv "OCAMLRUNPARAM" <> "b" with _ -> true) && not Helper.is_debug_run ->
@@ -664,41 +664,30 @@ module HighLevel = struct
 			| _ ->
 				args
 		in
-		let rec loop args0 did_hxb =
-			let current_each = !each_args in
-			begin try
-				let args,server_mode,ctx = try
-					process_params server_api create each_args !has_display comm.is_server args0
-				with Arg.Bad msg ->
-					let ctx = create 0 args in
-					error ctx ("Error: " ^ msg) null_pos;
-					[],SMNone,Some ctx
-				in
-				let code = match ctx with
-					| Some ctx ->
-						if not did_hxb && server_mode == SMNone && not !has_display && args = [] && not (List.mem "source-map" ctx.com.args) then
-							Define.raw_define ctx.com.defines "hxb.roundtrip";
-						(* Need chdir here because --cwd is eagerly applied in process_params *)
-						Unix.chdir curdir;
-						execute_ctx server_api ctx server_mode
-					| None ->
-						(* caused by --connect *)
-						0
-				in
-				(* print_endline (Printf.sprintf "restore_counter: %i" !HxbRestore.restore_counter); *)
-				if code = 0 && args <> [] && not !has_display then begin
-					(* We have to chdir here again because any --cwd also takes effect in execute_ctx *)
+		let rec loop args =
+			let args,server_mode,ctx = try
+				process_params server_api create each_args !has_display comm.is_server args
+			with Arg.Bad msg ->
+				let ctx = create 0 args in
+				error ctx ("Error: " ^ msg) null_pos;
+				[],SMNone,Some ctx
+			in
+			let code = match ctx with
+				| Some ctx ->
+					(* Need chdir here because --cwd is eagerly applied in process_params *)
 					Unix.chdir curdir;
-					loop args false
-				end else
-					code
-			with ServerCompilationContext.HxbRoundtrip ->
-				(* print_endline "Caught HxbRoundtrip, recursing"; *)
-				each_args := current_each;
+					execute_ctx server_api ctx server_mode
+				| None ->
+					(* caused by --connect *)
+					0
+			in
+			if code = 0 && args <> [] && not !has_display then begin
+				(* We have to chdir here again because any --cwd also takes effect in execute_ctx *)
 				Unix.chdir curdir;
-				loop args0 true
-			end
+				loop args
+			end else
+				code
 		in
-		let code = loop args false in
+		let code = loop args in
 		comm.exit code
 end

+ 0 - 1
src/compiler/haxe.ml

@@ -50,6 +50,5 @@ let args = List.tl (Array.to_list Sys.argv) in
 set_binary_mode_out stdout true;
 set_binary_mode_out stderr true;
 let sctx = ServerCompilationContext.create false in
-Server.enable_cache_mode sctx;
 Server.process sctx (Communication.create_stdio ()) args;
 other()

+ 0 - 8
src/compiler/serverCompilationContext.ml

@@ -3,8 +3,6 @@ open Common
 open Timer
 open CompilationCache
 
-exception HxbRoundtrip
-
 type t = {
 	(* If true, prints some debug information *)
 	verbose : bool;
@@ -65,12 +63,6 @@ let maybe_cache_context sctx com =
 		CommonCache.cache_context sctx.cs com;
 		t();
 		ServerMessage.cached_modules com "" (List.length com.modules);
-		match com.platform with
-		| Cross | Eval ->
-			()
-		| _ ->
-			if Common.raw_defined com "hxb.roundtrip" then
-				raise HxbRoundtrip
 	end
 
 let ensure_macro_setup sctx =

+ 0 - 0
tests/misc/projects/Issue11354/compile.hxml.disabled → tests/misc/projects/Issue11354/compile.hxml


+ 0 - 0
tests/misc/projects/Issue11354/proj/compile.hxml.disabled → tests/misc/projects/Issue11354/proj/compile.hxml


+ 0 - 5
tests/misc/src/Main.hx

@@ -159,11 +159,6 @@ class Main {
 				} catch (_) {}
 			}
 
-			// HXB_TODO: no comment
-			if (expected.length * 2 == content.length - 1) {
-				content = content.substr(0, expected.length);
-			}
-
 			if (content != expected) {
 				final a = new diff.FileData(Bytes.ofString(expected), "expected", Date.now());
 				final b = new diff.FileData(Bytes.ofString(content), "actual", Date.now());