Skip to content

Remove obsolete "bs.open" feature #6629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions jscomp/frontend/ast_attributes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,6 @@ let process_attributes_rev (attrs : t) : attr_kind * t =
Bs_syntaxerr.err loc Conflict_bs_bs_this_bs_meth
| _, _ -> (st, attr :: acc))

let process_pexp_fun_attributes_rev (attrs : t) =
Ext_list.fold_left attrs (false, [])
(fun (st, acc) (({txt; loc = _}, _) as attr) ->
match txt with
| "bs.open" -> (true, acc)
| _ -> (st, attr :: acc))

let process_bs (attrs : t) =
Ext_list.fold_left attrs (false, [])
(fun (st, acc) (({txt; loc = _}, _) as attr) ->
Expand Down
2 changes: 0 additions & 2 deletions jscomp/frontend/ast_attributes.mli
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ type attr_kind =

val process_attributes_rev : t -> attr_kind * t

val process_pexp_fun_attributes_rev : t -> bool * t

val process_bs : t -> bool * t

val has_inline_payload : t -> attr option
Expand Down
75 changes: 0 additions & 75 deletions jscomp/frontend/ast_bs_open.ml

This file was deleted.

30 changes: 0 additions & 30 deletions jscomp/frontend/ast_bs_open.mli

This file was deleted.

11 changes: 2 additions & 9 deletions jscomp/frontend/bs_builtin_ppx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,9 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
| Pexp_constant (Pconst_integer (s, Some 'l')) ->
{e with pexp_desc = Pexp_constant (Pconst_integer (s, None))}
(* End rewriting *)
| Pexp_function cases -> (
(* {[ function [@bs.exn]
| Not_found -> 0
| Invalid_argument -> 1
]}*)
| Pexp_function _ ->
async_context := false;
match Ast_attributes.process_pexp_fun_attributes_rev e.pexp_attributes with
| false, _ -> default_expr_mapper self e
| true, pexp_attributes ->
Ast_bs_open.convertBsErrorFunction e.pexp_loc self pexp_attributes cases)
default_expr_mapper self e
| _
when Ast_uncurried.exprIsUncurriedFun e
&&
Expand Down