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