Skip to content

Commit 2367f63

Browse files
committed
verbose name for readability
1 parent f636e66 commit 2367f63

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

jscomp/core/lam_compile_external_call.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,16 @@ let ocaml_to_js_eff
9797
: arg_expression * E.t list =
9898
let arg =
9999
match arg_label with
100-
| Optional ->
100+
| Arg_optional ->
101101
Js_of_lam_option.get_default_undefined_from_optional raw_arg
102-
| Label | Empty -> raw_arg
102+
| Arg_label | Arg_empty -> raw_arg
103103
in
104104
match arg_type with
105105
| Arg_cst _ -> assert false
106106
| Fn_uncurry_arity _ -> assert false
107107
(* has to be preprocessed by {!Lam} module first *)
108108
| Extern_unit ->
109-
(if arg_label = Empty then
109+
(if arg_label = Arg_empty then
110110
Splice0 else Splice1 E.unit),
111111
(if Js_analyzer.no_side_effect_expression arg then
112112
[]
@@ -132,7 +132,7 @@ let ocaml_to_js_eff
132132
| Unwrap ->
133133
let single_arg =
134134
match arg_label with
135-
| Optional ->
135+
| Arg_optional ->
136136
(**
137137
If this is an optional arg (like `?arg`), we have to potentially do
138138
2 levels of unwrapping:
@@ -174,8 +174,8 @@ let assemble_args_no_splice call_loc ffi
174174
match labels, args with
175175
| [], _
176176
-> assert (args = []) ; empty_pair
177-
| { arg_label = Empty | Label ; arg_type = Arg_cst cst } :: labels, args
178-
->
177+
| { arg_type = Arg_cst cst ; _} :: labels, args
178+
-> (* can not be Optional *)
179179
let accs, eff = aux labels args in
180180
Lam_compile_const.translate_arg_cst cst :: accs, eff
181181
| {arg_label ; arg_type } ::labels,
@@ -201,7 +201,7 @@ let assemble_args_has_splice call_loc ffi (arg_types : specs) (args : exprs)
201201
let rec aux (labels : specs) (args : exprs) =
202202
match labels, args with
203203
| [] , _ -> assert (args = []); empty_pair
204-
| { arg_label = Empty | Label; arg_type = Arg_cst cst} :: labels , args
204+
| { arg_type = Arg_cst cst; _} :: labels , args
205205
->
206206
let accs, eff = aux labels args in
207207
Lam_compile_const.translate_arg_cst cst :: accs, eff

jscomp/core/lam_compile_external_obj.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ let assemble_obj_args (labels : External_arg_spec.t list) (args : J.expression
5858
| ({arg_label = Label {name = label; cst = None} } as arg_kind)::labels, arg::args
5959
->
6060
let accs, eff, assign = aux labels args in
61-
let acc, new_eff = Lam_compile_external_call.ocaml_to_js_eff ~arg_label:Label ~arg_type:arg_kind.arg_type arg in
61+
let acc, new_eff = Lam_compile_external_call.ocaml_to_js_eff ~arg_label:Arg_label ~arg_type:arg_kind.arg_type arg in
6262
begin match acc with
6363
| Splice2 _
6464
| Splice0 -> assert false
@@ -72,7 +72,7 @@ let assemble_obj_args (labels : External_arg_spec.t list) (args : J.expression
7272
Js_of_lam_option.destruct_optional arg
7373
~for_sure_none:r
7474
~for_sure_some:(fun x -> let acc, new_eff = Lam_compile_external_call.ocaml_to_js_eff
75-
~arg_label:Label ~arg_type x in
75+
~arg_label:Arg_label ~arg_type x in
7676
begin match acc with
7777
| Splice2 _
7878
| Splice0 -> assert false
@@ -112,7 +112,7 @@ let assemble_obj_args (labels : External_arg_spec.t list) (args : J.expression
112112
let acc,new_eff =
113113
Lam_compile_external_call.ocaml_to_js_eff
114114
~arg_label:
115-
Empty ~arg_type:xlabel.arg_type
115+
Arg_empty ~arg_type:xlabel.arg_type
116116
(Js_of_lam_option.val_from_option arg) in
117117
begin match acc with
118118
| Splice1 v ->
@@ -131,7 +131,7 @@ let assemble_obj_args (labels : External_arg_spec.t list) (args : J.expression
131131
let acc,new_eff =
132132
Lam_compile_external_call.ocaml_to_js_eff
133133
~arg_label:
134-
Empty
134+
Arg_empty
135135
~arg_type:xlabel.arg_type
136136
(Js_of_lam_option.val_from_option arg) in
137137
begin match acc with

jscomp/syntax/ast_derive_abstract.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ let handleTdcl
148148
["" ; (* Not needed actually*)
149149
External_ffi_types.to_string
150150
(Ffi_bs (
151-
[{arg_type = Nothing; arg_label = Empty}],
151+
[{arg_type = Nothing; arg_label = Arg_empty}],
152152
Return_identity,
153153
Js_get {js_get_name = prim_as_name; js_get_scopes = []}
154154
))] )

jscomp/syntax/ast_external_process.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ let handle_attributes
864864
Location.raise_errorf ~loc:obj.ptyp_loc "[@bs.as] is not supported in bs.send type "
865865
| _ ->
866866
(* more error checking *)
867-
[{arg_label = Empty; arg_type}],
867+
[{arg_label = Arg_empty; arg_type}],
868868
[{label = Nolabel;
869869
ty = new_ty;
870870
attr = [];
@@ -902,22 +902,22 @@ let handle_attributes
902902
~loc
903903
"[@@bs.string] does not work with optional when it has arities in label %s" s
904904
| _ ->
905-
Optional, arg_type,
905+
Arg_optional, arg_type,
906906
param_type :: arg_types end
907907
| Labelled s ->
908908
begin match refine_arg_type ~nolabel:false ty with
909909
| new_ty, (Arg_cst _ as arg_type) ->
910-
Label , arg_type, arg_types
910+
Arg_label , arg_type, arg_types
911911
| new_ty, arg_type ->
912-
Label , arg_type,
912+
Arg_label , arg_type,
913913
{param_type with ty = new_ty} :: arg_types
914914
end
915915
| Nolabel ->
916916
begin match refine_arg_type ~nolabel:true ty with
917917
| new_ty , (Arg_cst _ as arg_type) ->
918-
Empty , arg_type, arg_types
918+
Arg_empty , arg_type, arg_types
919919
| new_ty , arg_type ->
920-
Empty, arg_type, {param_type with ty = new_ty} :: arg_types
920+
Arg_empty, arg_type, {param_type with ty = new_ty} :: arg_types
921921
end
922922
in
923923
({ arg_label ;

jscomp/syntax/external_arg_spec.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ type cst =
3434
| Arg_js_json of string
3535

3636
type label_noname =
37-
| Label
38-
| Empty
39-
| Optional
37+
| Arg_label
38+
| Arg_empty
39+
| Arg_optional
4040

4141
type label =
4242
| Label of {name : string ; cst : cst option }

jscomp/syntax/external_arg_spec.mli

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ type attr =
5252

5353

5454
type label_noname =
55-
| Label
56-
| Empty
57-
| Optional
55+
| Arg_label
56+
| Arg_empty
57+
| Arg_optional
5858

5959
type t =
6060
{

0 commit comments

Comments
 (0)