2
0
Simon Krajewski 1 жил өмнө
parent
commit
c2c8760a17

+ 4 - 4
src/compiler/compilationCache.ml

@@ -69,14 +69,14 @@ class context_cache (index : int) (sign : Digest.t) = object(self)
 	method find_module_extra path =
 	method find_module_extra path =
 		try (Hashtbl.find modules path).m_extra with Not_found -> (Hashtbl.find binary_cache path).mc_extra
 		try (Hashtbl.find modules path).m_extra with Not_found -> (Hashtbl.find binary_cache path).mc_extra
 
 
-	method cache_module display_source_at warn anon_identification hxb_writer_stats path m =
+	method cache_module warn anon_identification hxb_writer_stats path m =
 		match m.m_extra.m_kind with
 		match m.m_extra.m_kind with
 		| MImport ->
 		| MImport ->
 			Hashtbl.add modules m.m_path m
 			Hashtbl.add modules m.m_path m
 		| _ ->
 		| _ ->
-			let writer = new HxbWriter.hxb_writer display_source_at warn anon_identification hxb_writer_stats in
-			writer#write_module m;
-			let chunks = writer#get_chunks in
+			let writer = HxbWriter.create warn anon_identification hxb_writer_stats in
+			HxbWriter.write_module writer m;
+			let chunks = HxbWriter.get_chunks writer in
 			Hashtbl.replace binary_cache path {
 			Hashtbl.replace binary_cache path {
 				mc_path = path;
 				mc_path = path;
 				mc_id = m.m_id;
 				mc_id = m.m_id;

+ 3 - 3
src/compiler/generate.ml

@@ -42,10 +42,10 @@ let export_hxb com cc platform zip m =
 			with Not_found ->
 			with Not_found ->
 				let anon_identification = new tanon_identification in
 				let anon_identification = new tanon_identification in
 				let warn w s p = com.Common.warning w com.warning_options s p in
 				let warn w s p = com.Common.warning w com.warning_options s p in
-				let writer = new HxbWriter.hxb_writer (MessageReporting.display_source_at com) warn anon_identification com.hxb_writer_stats in
-				writer#write_module m;
+				let writer = HxbWriter.create warn anon_identification com.hxb_writer_stats in
+				HxbWriter.write_module writer m;
 				let out = IO.output_string () in
 				let out = IO.output_string () in
-				writer#export out;
+				HxbWriter.export writer out;
 				zip#add_entry (IO.close_out out) path;
 				zip#add_entry (IO.close_out out) path;
 		end
 		end
 	| _ ->
 	| _ ->

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 511 - 455
src/compiler/hxb/hxbWriter.ml


+ 1 - 1
src/context/commonCache.ml

@@ -89,7 +89,7 @@ let rec cache_context cs com =
 		(* If we have a signature mismatch, look-up cache for module. Physical equality check is fine as a heueristic. *)
 		(* If we have a signature mismatch, look-up cache for module. Physical equality check is fine as a heueristic. *)
 		let cc = if m.m_extra.m_sign = sign then cc else cs#get_context m.m_extra.m_sign in
 		let cc = if m.m_extra.m_sign = sign then cc else cs#get_context m.m_extra.m_sign in
 		let warn w s p = com.warning w com.warning_options s p in
 		let warn w s p = com.warning w com.warning_options s p in
-		cc#cache_module (MessageReporting.display_source_at com) warn anon_identification com.hxb_writer_stats m.m_path m;
+		cc#cache_module warn anon_identification com.hxb_writer_stats m.m_path m;
 	in
 	in
 	List.iter cache_module com.modules;
 	List.iter cache_module com.modules;
 	begin match com.get_macros() with
 	begin match com.get_macros() with

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно