|
1 | 1 | (* Copyright (C) 2015-2016 Bloomberg Finance L.P.
|
2 |
| - * |
| 2 | + * |
3 | 3 | * This program is free software: you can redistribute it and/or modify
|
4 | 4 | * it under the terms of the GNU Lesser General Public License as published by
|
5 | 5 | * the Free Software Foundation, either version 3 of the License, or
|
|
17 | 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18 | 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19 | 19 | * GNU Lesser General Public License for more details.
|
20 |
| - * |
| 20 | + * |
21 | 21 | * You should have received a copy of the GNU Lesser General Public License
|
22 | 22 | * along with this program; if not, write to the Free Software
|
23 | 23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
|
24 | 24 |
|
25 |
| -type module_bind_name = |
26 |
| - | Phint_name of string |
| 25 | +type module_bind_name = |
| 26 | + | Phint_name of string |
27 | 27 | (* explicit hint name *)
|
28 | 28 | | Phint_nothing
|
29 | 29 |
|
30 |
| -type external_module_name = |
31 |
| - { bundle : string ; |
| 30 | +type external_module_name = |
| 31 | + { bundle : string ; |
32 | 32 | module_bind_name : module_bind_name
|
33 | 33 | }
|
34 | 34 |
|
35 |
| -type pipe = bool |
36 |
| -type js_call = { |
| 35 | +type pipe = bool |
| 36 | +type js_call = { |
37 | 37 | name : string;
|
38 | 38 | external_module_name : external_module_name option;
|
39 | 39 | splice : bool ;
|
40 |
| - scopes : string list |
| 40 | + scopes : string list |
41 | 41 | }
|
42 | 42 |
|
43 |
| -type js_send = { |
| 43 | +type js_send = { |
44 | 44 | name : string ;
|
45 |
| - splice : bool ; |
| 45 | + splice : bool ; |
46 | 46 | pipe : pipe ;
|
47 |
| - js_send_scopes : string list; |
| 47 | + js_send_scopes : string list; |
48 | 48 | } (* we know it is a js send, but what will happen if you pass an ocaml objct *)
|
49 | 49 |
|
50 | 50 | type js_global_val = {
|
51 |
| - name : string ; |
| 51 | + name : string ; |
52 | 52 | external_module_name : external_module_name option;
|
53 | 53 | scopes : string list
|
54 | 54 | }
|
55 | 55 |
|
56 | 56 | type js_new_val = {
|
57 |
| - name : string ; |
| 57 | + name : string ; |
58 | 58 | external_module_name : external_module_name option;
|
59 | 59 | splice : bool ;
|
60 | 60 | scopes : string list;
|
61 | 61 | }
|
62 | 62 |
|
63 |
| -type js_module_as_fn = |
| 63 | +type js_module_as_fn = |
64 | 64 | { external_module_name : external_module_name;
|
65 |
| - splice : bool |
| 65 | + splice : bool |
66 | 66 | }
|
67 | 67 |
|
68 | 68 | type arg_type = External_arg_spec.attr
|
69 | 69 |
|
70 |
| -type arg_label = External_arg_spec.label |
| 70 | +type arg_label = External_arg_spec.label |
71 | 71 |
|
72 | 72 |
|
73 | 73 | type obj_create = External_arg_spec.t list
|
74 | 74 |
|
75 |
| -type js_get = |
| 75 | +type js_get = |
76 | 76 | { js_get_name : string ;
|
77 | 77 | js_get_scopes : string list;
|
78 | 78 | }
|
79 | 79 |
|
80 |
| -type js_set = |
| 80 | +type js_set = |
81 | 81 | { js_set_name : string ;
|
82 |
| - js_set_scopes : string list |
| 82 | + js_set_scopes : string list |
83 | 83 | }
|
84 | 84 |
|
85 | 85 |
|
86 | 86 | type js_get_index = {
|
87 |
| - js_get_index_scopes : string list |
| 87 | + js_get_index_scopes : string list |
88 | 88 | }
|
89 | 89 |
|
90 | 90 | type js_set_index = {
|
91 |
| - js_set_index_scopes : string list |
92 |
| -} |
| 91 | + js_set_index_scopes : string list |
| 92 | +} |
93 | 93 |
|
94 | 94 |
|
95 | 95 |
|
96 |
| -type attr = |
97 |
| - | Js_global of js_global_val |
| 96 | +type attr = |
| 97 | + | Js_global of js_global_val |
98 | 98 | | Js_module_as_var of external_module_name
|
99 | 99 | | Js_module_as_fn of js_module_as_fn
|
100 |
| - | Js_module_as_class of external_module_name |
101 |
| - | Js_call of js_call |
| 100 | + | Js_module_as_class of external_module_name |
| 101 | + | Js_call of js_call |
102 | 102 | | Js_send of js_send
|
103 | 103 | | Js_new of js_new_val
|
104 | 104 | | Js_set of js_set
|
105 | 105 | | Js_get of js_get
|
106 | 106 | | Js_get_index of js_get_index
|
107 |
| - | Js_set_index of js_set_index |
| 107 | + | Js_set_index of js_set_index |
108 | 108 |
|
109 |
| -type return_wrapper = |
110 |
| - | Return_unset |
| 109 | +type return_wrapper = |
| 110 | + | Return_unset |
111 | 111 | | Return_identity
|
112 |
| - | Return_undefined_to_opt |
| 112 | + | Return_undefined_to_opt |
113 | 113 | | Return_null_to_opt
|
114 | 114 | | Return_null_undefined_to_opt
|
115 | 115 | | Return_to_ocaml_bool
|
116 |
| - | Return_replaced_with_unit |
| 116 | + | Return_replaced_with_unit |
117 | 117 |
|
118 |
| -type t = |
119 |
| - | Ffi_bs of |
| 118 | +type t = |
| 119 | + | Ffi_bs of |
120 | 120 | External_arg_spec.t list *
|
121 |
| - return_wrapper * attr |
| 121 | + return_wrapper * |
| 122 | + attr |
122 | 123 | | Ffi_obj_create of obj_create
|
123 |
| - | Ffi_normal |
| 124 | + | Ffi_normal |
124 | 125 | (* When it's normal, it is handled as normal c functional ffi call *)
|
125 | 126 |
|
126 | 127 |
|
127 | 128 | val name_of_ffi : attr -> string
|
128 | 129 |
|
129 |
| -val check_ffi : ?loc:Location.t -> attr -> unit |
| 130 | +val check_ffi : ?loc:Location.t -> attr -> unit |
130 | 131 |
|
131 |
| -val to_string : t -> string |
| 132 | +val to_string : t -> string |
132 | 133 |
|
133 | 134 | (** Note *)
|
134 |
| -val from_string : string -> t |
| 135 | +val from_string : string -> t |
135 | 136 |
|
0 commit comments