Skip to content

Commit a04008c

Browse files
committed
Consolidate EmptyCst and Empty
1 parent 42d9f19 commit a04008c

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

jscomp/core/lam_compile_external_call.ml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ let ocaml_to_js_eff
100100
| Optional ->
101101
Js_of_lam_option.get_default_undefined_from_optional raw_arg
102102
| Label | Empty -> raw_arg
103-
| EmptyCst
104-
-> assert false in
103+
in
105104
match arg_type with
106105
| Arg_cst _ -> assert false
107106
| Fn_uncurry_arity _ -> assert false
@@ -175,7 +174,7 @@ let assemble_args_no_splice call_loc ffi
175174
match labels, args with
176175
| [], _
177176
-> assert (args = []) ; empty_pair
178-
| { arg_label = EmptyCst ; arg_type = Arg_cst cst } :: labels, args
177+
| { arg_label = Empty ; arg_type = Arg_cst cst } :: labels, args
179178
| { arg_label = Label ; arg_type = Arg_cst cst} :: labels, args ->
180179
let accs, eff = aux labels args in
181180
Lam_compile_const.translate_arg_cst cst :: accs, eff
@@ -187,8 +186,7 @@ let assemble_args_no_splice call_loc ffi
187186
~arg_label ~arg_type arg in
188187
append_list acc accs, Ext_list.append new_eff eff
189188
| { arg_label = Empty | Label | Optional ; _ } :: _ , []
190-
-> assert false
191-
| {arg_label = EmptyCst ; _} :: _, _ -> assert false
189+
-> assert false
192190
in
193191
let args, eff = aux arg_types args in
194192
args,
@@ -203,7 +201,7 @@ let assemble_args_has_splice call_loc ffi (arg_types : specs) (args : exprs)
203201
let rec aux (labels : specs) (args : exprs) =
204202
match labels, args with
205203
| [] , _ -> assert (args = []); empty_pair
206-
| { arg_label = EmptyCst ; arg_type = Arg_cst cst} :: labels , args
204+
| { arg_label = Empty ; arg_type = Arg_cst cst} :: labels , args
207205
| { arg_label = Label ; arg_type = Arg_cst cst } :: labels , args ->
208206
let accs, eff = aux labels args in
209207
Lam_compile_const.translate_arg_cst cst :: accs, eff
@@ -220,8 +218,7 @@ let assemble_args_has_splice call_loc ffi (arg_types : specs) (args : exprs)
220218
append_list acc accs, Ext_list.append new_eff eff
221219
end
222220
| { arg_label = Empty | Label | Optional ; _ } :: _ , []
223-
-> assert false
224-
| {arg_label = EmptyCst ;_ } :: _, _ -> assert false
221+
-> assert false
225222
in
226223
let args, eff = aux arg_types args in
227224
args,

jscomp/syntax/ast_external_process.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ let handle_attributes
915915
| Nolabel ->
916916
begin match refine_arg_type ~nolabel:true ty with
917917
| new_ty , (Arg_cst _ as arg_type) ->
918-
EmptyCst , arg_type, arg_types
918+
Empty , arg_type, arg_types
919919
| new_ty , arg_type ->
920920
Empty, arg_type, {param_type with ty = new_ty} :: arg_types
921921
end

jscomp/syntax/external_arg_spec.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ type cst =
3636
type label_noname =
3737
| Label
3838
| Empty
39-
| EmptyCst
4039
| Optional
4140

4241
type label =

jscomp/syntax/external_arg_spec.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ type attr =
5454
type label_noname =
5555
| Label
5656
| Empty
57-
| EmptyCst
5857
| Optional
5958

6059
type t =

0 commit comments

Comments
 (0)