Skip to content

Commit 626224e

Browse files
committed
Remove processing of @bs which is from ocaml.
1 parent 46bf066 commit 626224e

File tree

5 files changed

+2
-29
lines changed

5 files changed

+2
-29
lines changed

jscomp/frontend/ast_attributes.ml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,15 @@ let process_method_attributes_rev (attrs : t) =
7777
type attr_kind =
7878
| Nothing
7979
| Meth_callback of attr
80-
| Uncurry of attr
8180
| Method of attr
8281

8382
let process_attributes_rev (attrs : t) : attr_kind * t =
8483
Ext_list.fold_left attrs (Nothing, [])
8584
(fun (st, acc) (({txt; loc}, _) as attr) ->
8685
match (txt, st) with
87-
| "bs", (Nothing | Uncurry _) ->
88-
(Uncurry attr, acc) (* TODO: warn unused/duplicated attribute *)
8986
| "this", (Nothing | Meth_callback _) -> (Meth_callback attr, acc)
9087
| "meth", (Nothing | Method _) -> (Method attr, acc)
91-
| ("bs" | "this"), _ -> Bs_syntaxerr.err loc Conflict_bs_bs_this_bs_meth
88+
| ("this"), _ -> Bs_syntaxerr.err loc Conflict_bs_bs_this_bs_meth
9289
| _, _ -> (st, attr :: acc))
9390

9491
let process_bs (attrs : t) =

jscomp/frontend/ast_attributes.mli

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ val process_method_attributes_rev : t -> (bool * bool, [`Get | `No_get]) st * t
3232
type attr_kind =
3333
| Nothing
3434
| Meth_callback of attr
35-
| Uncurry of attr
3635
| Method of attr
3736

3837
val process_attributes_rev : t -> attr_kind * t
@@ -47,7 +46,7 @@ val has_async_payload : t -> attr option
4746
type derive_attr = {bs_deriving: Ast_payload.action list option} [@@unboxed]
4847

4948
val iter_process_bs_string_int_unwrap_uncurry :
50-
t -> [`Nothing | `String | `Int | `Ignore | `Unwrap | `Uncurry of int option]
49+
t -> [`Nothing | `String | `Int | `Ignore | `Unwrap]
5150

5251
val iter_process_bs_string_as : t -> string option
5352

jscomp/frontend/ast_core_type_class_type.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ let typ_mapper (self : Bs_ast_mapper.mapper) (ty : Parsetree.core_type) =
8080
ptyp_loc = loc;
8181
} -> (
8282
match fst (Ast_attributes.process_attributes_rev ptyp_attributes) with
83-
| Uncurry _ -> Ast_typ_uncurry.to_uncurry_type loc self label args body
8483
| Meth_callback _ ->
8584
Ast_typ_uncurry.to_method_callback_type loc self label args body
8685
| Method _ ->
@@ -100,7 +99,6 @@ let typ_mapper (self : Bs_ast_mapper.mapper) (ty : Parsetree.core_type) =
10099
let attrs, core_type =
101100
match Ast_attributes.process_attributes_rev attrs with
102101
| Nothing, attrs -> (attrs, ty) (* #1678 *)
103-
| Uncurry attr, attrs -> (attrs, attr +> ty)
104102
| Method _, _ ->
105103
Location.raise_errorf ~loc "%@get/set conflicts with %@meth"
106104
| Meth_callback attr, attrs -> (attrs, attr +> ty)
@@ -111,7 +109,6 @@ let typ_mapper (self : Bs_ast_mapper.mapper) (ty : Parsetree.core_type) =
111109
let attrs, core_type =
112110
match Ast_attributes.process_attributes_rev attrs with
113111
| Nothing, attrs -> (attrs, ty)
114-
| Uncurry attr, attrs -> (attrs, attr +> ty)
115112
| Method _, _ ->
116113
Location.raise_errorf ~loc "%@get/set conflicts with %@meth"
117114
| Meth_callback attr, attrs -> (attrs, attr +> ty)
@@ -124,7 +121,6 @@ let typ_mapper (self : Bs_ast_mapper.mapper) (ty : Parsetree.core_type) =
124121
let attrs, core_type =
125122
match Ast_attributes.process_attributes_rev ptyp_attrs with
126123
| Nothing, attrs -> (attrs, ty)
127-
| Uncurry attr, attrs -> (attrs, attr +> ty)
128124
| Method attr, attrs -> (attrs, attr +> ty)
129125
| Meth_callback attr, attrs -> (attrs, attr +> ty)
130126
in

jscomp/frontend/ast_external_process.ml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,6 @@ let spec_of_ptyp (nolabel : bool) (ptyp : Parsetree.core_type) :
6666
Unwrap
6767
(* Unwrap attribute can only be attached to things like `[a of a0 | b of b0]` *)
6868
| _ -> Bs_syntaxerr.err ptyp.ptyp_loc Invalid_bs_unwrap_type)
69-
| `Uncurry opt_arity -> (
70-
let real_arity =
71-
if Ast_uncurried.core_type_is_uncurried_fun ptyp then
72-
let arity, _ = Ast_uncurried.core_type_extract_uncurried_fun ptyp in
73-
Some arity
74-
else Ast_core_type.get_uncurry_arity ptyp
75-
in
76-
match (opt_arity, real_arity) with
77-
| Some arity, None -> Fn_uncurry_arity arity
78-
| None, None -> Bs_syntaxerr.err ptyp.ptyp_loc Canot_infer_arity_by_syntax
79-
| None, Some arity -> Fn_uncurry_arity arity
80-
| Some arity, Some n ->
81-
if n <> arity then
82-
Bs_syntaxerr.err ptyp.ptyp_loc (Inconsistent_arity (arity, n))
83-
else Fn_uncurry_arity arity)
8469
| `Nothing -> (
8570
match ptyp_desc with
8671
| Ptyp_constr ({txt = Lident "unit"; _}, []) ->

jscomp/frontend/bs_builtin_ppx.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
138138
async_context := (old_in_function_def && !async_context) || async;
139139
in_function_def := true;
140140
Ast_async.make_function_async ~async (default_expr_mapper self e)
141-
| Uncurry _, pexp_attributes ->
142-
async_context := async;
143-
Ast_uncurry_gen.to_uncurry_fn {e with pexp_attributes} self label pat body
144-
async
145141
| Method _, _ ->
146142
Location.raise_errorf ~loc:e.pexp_loc
147143
"%@meth is not supported in function expression"

0 commit comments

Comments
 (0)