Skip to content

Commit cfd4eb9

Browse files
committed
Remove more "bs."
1 parent 2e68cb6 commit cfd4eb9

32 files changed

+51
-52
lines changed

jscomp/build_tests/cmd/input.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ var bsc_exe_path = require("../../../scripts/bin_path").bsc_exe;
77
var react = `
88
type u
99
10-
external a : u = "react" [@@bs.module]
10+
external a : u = "react" [@@module]
1111
12-
external b : unit -> int = "bool" [@@bs.module "react"]
12+
external b : unit -> int = "bool" [@@module "react"]
1313
1414
let v = a
1515
let h = b ()
@@ -19,9 +19,9 @@ var foo_react = `
1919
type bla
2020
2121
22-
external foo : bla = "foo.react" [@@bs.module]
22+
external foo : bla = "foo.react" [@@module]
2323
24-
external bar : unit -> bla = "bar" [@@bs.val] [@@bs.module "foo.react"]
24+
external bar : unit -> bla = "bar" [@@bs.val] [@@module "foo.react"]
2525
2626
let c = foo
2727

jscomp/frontend/ast_attributes.ml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ let process_attributes_rev (attrs : t) : attr_kind * t =
8888
(Uncurry attr, acc) (* TODO: warn unused/duplicated attribute *)
8989
| ("bs.this" | "this"), (Nothing | Meth_callback _) ->
9090
(Meth_callback attr, acc)
91-
| ("bs.meth" | "meth"), (Nothing | Method _) -> (Method attr, acc)
91+
| "meth", (Nothing | Method _) -> (Method attr, acc)
9292
| ("bs" | "bs.this" | "this"), _ ->
9393
Bs_syntaxerr.err loc Conflict_bs_bs_this_bs_meth
9494
| _, _ -> (st, attr :: acc))
@@ -154,8 +154,7 @@ let rs_externals (attrs : t) pval_prim =
154154
|| Ext_array.exists external_attrs (fun (x : string) -> txt = x))
155155
|| prims_to_be_encoded pval_prim
156156

157-
let is_inline : attr -> bool =
158-
fun ({txt}, _) -> txt = "bs.inline" || txt = "inline"
157+
let is_inline : attr -> bool = fun ({txt}, _) -> txt = "inline"
159158

160159
let has_inline_payload (attrs : t) = Ext_list.find_first attrs is_inline
161160

@@ -223,8 +222,8 @@ let iter_process_bs_string_int_unwrap_uncurry (attrs : t) =
223222
Ext_list.iter attrs (fun (({txt; loc = _}, (payload : _)) as attr) ->
224223
match txt with
225224
| "bs.string" | "string" -> assign `String attr
226-
| "bs.int" | "int" -> assign `Int attr
227-
| "bs.ignore" | "ignore" -> assign `Ignore attr
225+
| "int" -> assign `Int attr
226+
| "ignore" -> assign `Ignore attr
228227
| "bs.unwrap" | "unwrap" -> assign `Unwrap attr
229228
| "bs.uncurry" | "uncurry" ->
230229
assign (`Uncurry (Ast_payload.is_single_int payload)) attr

jscomp/frontend/ast_external_process.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ let parse_external_attributes (no_arguments : bool) (prim_name_check : string)
266266
st with
267267
call_name = Some (name_from_payload_or_prim ~loc payload);
268268
}
269-
| "bs.module" | "module" -> (
269+
| "module" -> (
270270
match payload with
271271
| PStr
272272
[
@@ -391,7 +391,7 @@ let parse_external_attributes (no_arguments : bool) (prim_name_check : string)
391391
{st with set_name = Some (name_from_payload_or_prim ~loc payload)}
392392
| "get" ->
393393
{st with get_name = Some (name_from_payload_or_prim ~loc payload)}
394-
| "bs.new" | "new" ->
394+
| "new" ->
395395
{st with new_name = Some (name_from_payload_or_prim ~loc payload)}
396396
| "set_index" ->
397397
if String.length prim_name_check <> 0 then

jscomp/frontend/external_arg_spec.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type cst = private Arg_int_lit of int | Arg_string_lit of string * delim
2929
type attr =
3030
| Poly_var_string of {descr: (string * string) list}
3131
| Poly_var of {descr: (string * string) list option}
32-
| Int of (string * int) list (* ([`a | `b ] [@bs.int])*)
32+
| Int of (string * int) list (* ([`a | `b ] [@int])*)
3333
| Arg_cst of cst
3434
| Fn_uncurry_arity of
3535
int (* annotated with [@bs.uncurry ] or [@bs.uncurry 2]*)

jscomp/frontend/typemod_hide.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let no_type_defined (x : Parsetree.structure_item) =
4646
generated code from:
4747
{[
4848
external %private x : int -> int = "x"
49-
[@@bs.module "./x"]
49+
[@@module "./x"]
5050
]}
5151
*)
5252
| _ -> false

jscomp/gentype/Annotation.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let toString annotation =
2020
let tagIsGenType s = s = "genType" || s = "gentype"
2121
let tagIsGenTypeAs s = s = "genType.as" || s = "gentype.as"
2222
let tagIsAs s = s = "as"
23-
let tagIsInt s = s = "bs.int" || s = "int"
23+
let tagIsInt s = s = "int"
2424
let tagIsString s = s = "bs.string" || s = "string"
2525

2626
let tagIsTag s = s = "tag"

jscomp/gentype/TranslateStructure.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ and translateStructureItem ~config ~outputFileRelative ~resolver ~typeEnv
293293
|> Translation.combine
294294
| {
295295
str_desc =
296-
(* ReScript's encoding of bs.module: include with constraint. *)
296+
(* ReScript's encoding of @module: include with constraint. *)
297297
Tstr_include
298298
{
299299
incl_mod =

jscomp/gentype/Translation.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ let translateValue ~attributes ~config ~docString ~outputFileRelative ~resolver
112112

113113
(**
114114
[@genType]
115-
[@bs.module] external myBanner : ReasonReact.reactClass = "./MyBanner";
115+
[@module] external myBanner : ReasonReact.reactClass = "./MyBanner";
116116
*)
117117
let translatePrimitive ~config ~outputFileRelative ~resolver ~typeEnv
118118
(valueDescription : Typedtree.value_description) : t =

jscomp/ml/oprint.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ and print_simple_out_type ppf =
288288
Otyp_arrow ("", Otyp_constr (Oide_ident "unit", []),tyl)
289289
else tyl
290290
in
291-
fprintf ppf "@[<0>(%a@ [@bs.meth])@]" print_out_type_1 res
291+
fprintf ppf "@[<0>(%a@ [@meth])@]" print_out_type_1 res
292292
| Otyp_constr (Oide_dot (Oide_dot (Oide_ident "Js_OO", "Callback" ), _),
293293
[tyl])
294294
->

jscomp/runtime/caml_sys.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ let sys_time = () =>
6868

6969
/*
7070
type spawnResult
71-
external spawnSync : string -> spawnResult = "spawnSync" [@@bs.module "child_process"]
71+
external spawnSync : string -> spawnResult = "spawnSync" [@@module "child_process"]
7272
7373
external readAs : spawnResult ->
7474
<

0 commit comments

Comments
 (0)