Procházet zdrojové kódy

[gencommon] minor cleanup for InterfaceProps

Dan Korostelev před 9 roky
rodič
revize
c9f9da4e45
1 změnil soubory, kde provedl 11 přidání a 22 odebrání
  1. 11 22
      src/generators/gencommon.ml

+ 11 - 22
src/generators/gencommon.ml

@@ -9949,33 +9949,27 @@ struct
 
 end;;
 
+
 (* ******************************************* *)
 (* InterfaceProps *)
 (* ******************************************* *)
-
 (*
-
 	This module filter will go through all declared properties, and see if they are conforming to a native interface.
-	If they are, it will add Meta.Property to it
-
-	dependencies:
-
+	If they are, it will add Meta.Property to it.
 *)
-
 module InterfaceProps =
 struct
 	let name = "interface_props"
-
 	let priority = solve_deps name []
 
-	let run gen =
-		let run md = match md with
-			| TClassDecl ( { cl_interface = false; cl_extern = false } as cl ) ->
+	let configure gen =
+		let run md =
+			match md with
+			| TClassDecl ({ cl_interface = false; cl_extern = false } as cl) ->
 				let vars = List.fold_left (fun acc (iface,_) ->
 					if Meta.has Meta.CsNative iface.cl_meta then
 						List.filter (fun cf -> match cf.cf_kind with
-							| Var { v_read = AccCall } | Var { v_write = AccCall } ->
-								true
+							| Var { v_read = AccCall } | Var { v_write = AccCall } -> true
 							| _ -> false
 						) iface.cl_ordered_fields @ acc
 					else
@@ -9987,16 +9981,11 @@ struct
 						| Var { v_read = AccCall } | Var { v_write = AccCall } when List.mem cf.cf_name vars ->
 							cf.cf_meta <- (Meta.Property, [], Ast.null_pos) :: cf.cf_meta
 						| _ -> ()
-					) cl.cl_ordered_fields;
-
-				md
-			| _ -> md
+					) cl.cl_ordered_fields
+			| _ ->
+				()
 		in
-		run
-
-	let configure gen =
-		let run = run gen in
-		let map md = Some(run md) in
+		let map md = Some(run md; md) in
 		gen.gmodule_filters#add ~name:name ~priority:(PCustom priority) map
 end;;