Skip to content

Commit 541963b

Browse files
committed
remove some indirection due to legacy of Ast_compatible
1 parent 9f61c3f commit 541963b

File tree

6 files changed

+16
-23
lines changed

6 files changed

+16
-23
lines changed

jscomp/core/js_of_lam_variant.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type arg_expression =
3131
| Splice2 of E.t * E.t
3232

3333
(* we need destruct [undefined] when input is optional *)
34-
let eval (arg : J.expression) (dispatches : (Ast_compatible.hash_label * string) list ) : E.t =
34+
let eval (arg : J.expression) (dispatches : (string * string) list ) : E.t =
3535
if arg == E.undefined then E.undefined
3636
else
3737
match arg.expression_desc with
@@ -51,7 +51,7 @@ let eval (arg : J.expression) (dispatches : (Ast_compatible.hash_label * string)
5151

5252
(** invariant: optional is not allowed in this case *)
5353
(** arg is a polyvar *)
54-
let eval_as_event (arg : J.expression) (dispatches : (Ast_compatible.hash_label * string) list option) =
54+
let eval_as_event (arg : J.expression) (dispatches : (string * string) list option) =
5555
match arg.expression_desc with
5656
| Caml_block([{expression_desc = Str(_,s)}; cb], _, _, Blk_poly_var ) when Js_analyzer.no_side_effect_expression cb
5757
->
@@ -94,7 +94,7 @@ let eval_as_event (arg : J.expression) (dispatches : (Ast_compatible.hash_label
9494
*)
9595

9696
(* we need destruct [undefined] when input is optional *)
97-
let eval_as_int (arg : J.expression) (dispatches : (Ast_compatible.hash_label * int) list ) : E.t =
97+
let eval_as_int (arg : J.expression) (dispatches : (string * int) list ) : E.t =
9898
if arg == E.undefined then E.undefined else
9999
match arg.expression_desc with
100100
| Str(_,i) ->

jscomp/core/js_of_lam_variant.mli

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ type arg_expression =
3131

3232
val eval :
3333
J.expression ->
34-
(Ast_compatible.hash_label * string) list
34+
(string * string) list
3535
-> J.expression
3636

3737
val eval_as_event :
3838
J.expression ->
39-
(Ast_compatible.hash_label * string) list option
39+
(string * string) list option
4040
-> arg_expression
4141

4242
val eval_as_int :
4343
J.expression ->
44-
(Ast_compatible.hash_label * int) list ->
44+
(string * int) list ->
4545
J.expression
4646

4747
val eval_as_unwrap : J.expression -> J.expression

jscomp/syntax/ast_compatible.mli

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

2525

26-
type poly_var_label = Asttypes.label Asttypes.loc
26+
2727

2828

2929

@@ -33,7 +33,7 @@ type poly_var_label = Asttypes.label Asttypes.loc
3333

3434
type loc = Location.t
3535
type attrs = Parsetree.attribute list
36-
type hash_label = string
36+
3737
open Parsetree
3838

3939

@@ -50,20 +50,13 @@ val const_exp_int:
5050
int ->
5151
expression
5252

53-
val const_hash_label :
54-
?loc:Location.t ->
55-
?attrs:attrs ->
56-
string ->
57-
expression
5853

5954

6055
val const_exp_int_list_as_array:
6156
int list ->
6257
expression
6358

64-
(* val const_exp_string_list_as_array:
65-
string list ->
66-
expression *)
59+
6760

6861

6962
val apply_simple:

jscomp/syntax/ast_polyvar.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
val map_row_fields_into_ints:
2727
Location.t ->
2828
Parsetree.row_field list ->
29-
(Ast_compatible.hash_label * int ) list
29+
(string * int ) list
3030

3131
val map_constructor_declarations_into_ints:
3232
Parsetree.constructor_declaration list ->

jscomp/syntax/external_arg_spec.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ type label =
5050
type attr =
5151
| Poly_var_string of {
5252
descr :
53-
(Ast_compatible.hash_label * string) list
53+
(string * string) list
5454
(* introduced by attributes bs.string
5555
and bs.as
5656
*)
5757
}
5858
| Poly_var of {
5959
descr :
60-
(Ast_compatible.hash_label * string) list option
60+
(string * string) list option
6161
(* introduced by attributes bs.string
6262
and bs.as
6363
*)
6464
}
6565
(* `a does not have any value*)
66-
| Int of (Ast_compatible.hash_label * int ) list (* ([`a | `b ] [@bs.int])*)
66+
| Int of (string * int ) list (* ([`a | `b ] [@bs.int])*)
6767
| Arg_cst of cst
6868
| Fn_uncurry_arity of int (* annotated with [@bs.uncurry ] or [@bs.uncurry 2]*)
6969
(* maybe we can improve it as a combination of {!Asttypes.constant} and tuple *)

jscomp/syntax/external_arg_spec.mli

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ type label = private
4343
type attr =
4444
| Poly_var_string of {
4545
descr :
46-
(Ast_compatible.hash_label * string) list
46+
(string * string) list
4747
}
4848
| Poly_var of {
4949
descr :
50-
(Ast_compatible.hash_label * string) list option
50+
(string * string) list option
5151
}
52-
| Int of (Ast_compatible.hash_label * int ) list (* ([`a | `b ] [@bs.int])*)
52+
| Int of (string * int ) list (* ([`a | `b ] [@bs.int])*)
5353
| Arg_cst of cst
5454
| Fn_uncurry_arity of int (* annotated with [@bs.uncurry ] or [@bs.uncurry 2]*)
5555
(* maybe we can improve it as a combination of {!Asttypes.constant} and tuple *)

0 commit comments

Comments
 (0)