Explorar o código

[gencommon] get rid of Gencommon dependency for SetHXGen filter

Dan Korostelev %!s(int64=8) %!d(string=hai) anos
pai
achega
f1f12abdcc

+ 4 - 5
src/generators/gencommon/setHXGen.ml

@@ -18,7 +18,6 @@
 *)
 *)
 open Common
 open Common
 open Type
 open Type
-open Gencommon
 
 
 (* ******************************************* *)
 (* ******************************************* *)
 (* set hxgen module *)
 (* set hxgen module *)
@@ -33,7 +32,7 @@ open Gencommon
 	The only option is to run this filter eagerly, because it must be one of the first filters to run,
 	The only option is to run this filter eagerly, because it must be one of the first filters to run,
 	since many others depend of it.
 	since many others depend of it.
 *)
 *)
-let run_filter gen =
+let run_filter com types =
 	let rec is_hxgen md =
 	let rec is_hxgen md =
 		match md with
 		match md with
 		| TClassDecl { cl_kind = KAbstractImpl a } ->
 		| TClassDecl { cl_kind = KAbstractImpl a } ->
@@ -70,7 +69,7 @@ let run_filter gen =
 				if Meta.has Meta.FlatEnum e.e_meta then
 				if Meta.has Meta.FlatEnum e.e_meta then
 					false
 					false
 				else begin
 				else begin
-					gen.gcon.error "Only flat enums may be @:nativeGen" e.e_pos;
+					com.error "Only flat enums may be @:nativeGen" e.e_pos;
 					true
 					true
 				end
 				end
 			else
 			else
@@ -80,7 +79,7 @@ let run_filter gen =
 		| TAbstractDecl a ->
 		| TAbstractDecl a ->
 			(match follow a.a_this with
 			(match follow a.a_this with
 			| TInst _ | TEnum _ | TAbstract _ ->
 			| TInst _ | TEnum _ | TAbstract _ ->
-				is_hxgen (t_to_md (follow a.a_this))
+				is_hxgen (module_type_of_type (follow a.a_this))
 			| _ ->
 			| _ ->
 				not (Meta.has Meta.NativeGen a.a_meta))
 				not (Meta.has Meta.NativeGen a.a_meta))
 		| TTypeDecl t -> (* TODO see when would we use this *)
 		| TTypeDecl t -> (* TODO see when would we use this *)
@@ -96,4 +95,4 @@ let run_filter gen =
 		| TAbstractDecl a -> a.a_meta <- (meta, [], a.a_pos) :: a.a_meta
 		| TAbstractDecl a -> a.a_meta <- (meta, [], a.a_pos) :: a.a_meta
 	in
 	in
 
 
-	List.iter filter gen.gtypes_list
+	List.iter filter types

+ 1 - 1
src/generators/gencs.ml

@@ -2615,7 +2615,7 @@ let configure gen =
 	gen.greal_type <- real_type;
 	gen.greal_type <- real_type;
 	gen.greal_type_param <- change_param_type;
 	gen.greal_type_param <- change_param_type;
 
 
-	SetHXGen.run_filter gen;
+	SetHXGen.run_filter gen.gcon gen.gtypes_list;
 
 
 	(* before running the filters, follow all possible types *)
 	(* before running the filters, follow all possible types *)
 	(* this is needed so our module transformations don't break some core features *)
 	(* this is needed so our module transformations don't break some core features *)

+ 1 - 1
src/generators/genjava.ml

@@ -2037,7 +2037,7 @@ let configure gen =
 	gen.greal_type <- real_type;
 	gen.greal_type <- real_type;
 	gen.greal_type_param <- change_param_type;
 	gen.greal_type_param <- change_param_type;
 
 
-	SetHXGen.run_filter gen;
+	SetHXGen.run_filter gen.gcon gen.gtypes_list;
 
 
 	(* before running the filters, follow all possible types *)
 	(* before running the filters, follow all possible types *)
 	(* this is needed so our module transformations don't break some core features *)
 	(* this is needed so our module transformations don't break some core features *)