Skip to content

Commit fa87fd0

Browse files
committed
clean up
1 parent 743202d commit fa87fd0

8 files changed

+14
-19
lines changed

jscomp/core/lam.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ type primitive =
8585
| Pjs_call of
8686
string * (* prim_name *)
8787
External_arg_spec.t list * (* arg_types *)
88-
External_ffi_types.ffi (* ffi *)
88+
External_ffi_types.attr (* ffi *)
8989
| Pjs_object_create of External_ffi_types.obj_create
9090
(* Exceptions *)
9191
| Praise

jscomp/core/lam.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ type primitive =
8282
(* Location.t * [loc] is passed down *)
8383
string * (* prim_name *)
8484
External_arg_spec.t list * (* arg_types *)
85-
External_ffi_types.ffi (* ffi *)
85+
External_ffi_types.attr (* ffi *)
8686
| Pjs_object_create of External_ffi_types.obj_create
8787

8888
| Praise

jscomp/core/lam_compile_external_call.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ let translate_scoped_access scopes obj =
229229
List.fold_left (fun acc x -> E.dot acc x) (E.dot obj x) xs
230230

231231
let translate_ffi
232-
call_loc (ffi : External_ffi_types.ffi )
233-
(* prim_name *)
232+
call_loc
234233
(cxt : Lam_compile_context.t)
235234
arg_types
235+
(ffi : External_ffi_types.attr )
236236
(args : J.expression list) =
237237
match ffi with
238238

jscomp/core/lam_compile_external_call.mli

+1-3
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ val ocaml_to_js_eff :
3737

3838
val translate_ffi :
3939
Location.t ->
40-
External_ffi_types.ffi ->
41-
(* string -> *) (* Not used.. *)
4240
Lam_compile_context.t ->
4341
External_arg_spec.t list ->
44-
(*bool -> *)
42+
External_ffi_types.attr ->
4543
J.expression list ->
4644
J.expression
4745

jscomp/core/lam_compile_primitive.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ let translate loc
681681
(*Lam_compile_external_obj.assemble_args_obj labels args *)
682682
| Pjs_call (_, arg_types, ffi) ->
683683
Lam_compile_external_call.translate_ffi
684-
loc ffi cxt arg_types args
684+
loc cxt arg_types ffi args
685685
(** FIXME, this can be removed later *)
686686
| Pisint ->
687687
begin

jscomp/syntax/external_ffi_types.ml

+3-6
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ type arg_label = External_arg_spec.label
8989
(**TODO: maybe we can merge [arg_label] and [arg_type] *)
9090
type obj_create = External_arg_spec.t list
9191

92-
type ffi =
93-
(* | Obj_create of obj_create *)
92+
type attr =
9493
| Js_global of js_global_val
9594
| Js_module_as_var of external_module_name
9695
| Js_module_as_fn of js_module_as_fn
@@ -121,8 +120,6 @@ let name_of_ffi ffi =
121120
| Js_global v
122121
->
123122
Printf.sprintf "[@@bs.val] %S " v.name
124-
(* | Obj_create _ ->
125-
Printf.sprintf "[@@bs.obj]" *)
126123

127124
type return_wrapper =
128125
| Return_unset
@@ -134,8 +131,8 @@ type return_wrapper =
134131
| Return_replaced_with_unit
135132
type t =
136133
| Ffi_bs of External_arg_spec.t list *
137-
return_wrapper * ffi
138-
(** [Ffi_bs(args,return,ffi) ]
134+
return_wrapper * attr
135+
(** [Ffi_bs(args,return,attr) ]
139136
[return] means return value is unit or not,
140137
[true] means is [unit]
141138
*)

jscomp/syntax/external_ffi_types.mli

+4-4
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ type js_set_index = {
8989

9090

9191

92-
type ffi =
92+
type attr =
9393
| Js_global of js_global_val
9494
| Js_module_as_var of external_module_name
9595
| Js_module_as_fn of js_module_as_fn
@@ -114,15 +114,15 @@ type return_wrapper =
114114
type t =
115115
| Ffi_bs of
116116
External_arg_spec.t list *
117-
return_wrapper * ffi
117+
return_wrapper * attr
118118
| Ffi_obj_create of obj_create
119119
| Ffi_normal
120120
(* When it's normal, it is handled as normal c functional ffi call *)
121121

122122

123-
val name_of_ffi : ffi -> string
123+
val name_of_ffi : attr -> string
124124

125-
val check_ffi : ?loc:Location.t -> ffi -> unit
125+
val check_ffi : ?loc:Location.t -> attr -> unit
126126

127127
val to_string : t -> string
128128

jscomp/syntax/external_process.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ let handle_attributes
649649

650650
| {val_send_pipe = None ; _ } -> [],[], 0) in
651651

652-
let ffi : External_ffi_types.ffi = match st with
652+
let ffi : External_ffi_types.attr = match st with
653653
| {set_index = true;
654654

655655
val_name = `Nm_na;

0 commit comments

Comments
 (0)