Skip to content

Commit 3b5f75c

Browse files
committed
@bs.config -> @config
1 parent ca66041 commit 3b5f75c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+54
-60
lines changed

jscomp/bsc/rescript_compiler_main.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
457457

458458

459459

460-
(** parse flags in bs.config *)
460+
(** parse flags in config *)
461461
let file_level_flags_handler (e : Parsetree.expression option) =
462462
match e with
463463
| None -> ()

jscomp/build_tests/react_ppx/src/recursive_component_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@@warning("-39")
22
// https://github.com/rescript-lang/rescript-compiler/issues/4511
33
/*
4-
[@bs.config {
4+
[@config {
55
flags : [|"-dsource"|]
66
}];
77
*/

jscomp/frontend/ast_config.ml

+4-10
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,8 @@ let process_directives str =
5757
let rec iter_on_bs_config_str (x : Parsetree.structure) =
5858
match x with
5959
| [] -> ()
60-
| {
61-
pstr_desc =
62-
Pstr_attribute (({txt = "bs.config" | "config"; loc}, payload) as attr);
63-
}
64-
:: _ ->
60+
| {pstr_desc = Pstr_attribute (({txt = "config"; loc}, payload) as attr)} :: _
61+
->
6562
Bs_ast_invariant.mark_used_bs_attribute attr;
6663
Ext_list.iter
6764
(Ast_payload.ident_or_record_as_config loc payload)
@@ -76,11 +73,8 @@ let process_str str =
7673
let rec iter_on_bs_config_sig (x : Parsetree.signature) =
7774
match x with
7875
| [] -> ()
79-
| {
80-
psig_desc =
81-
Psig_attribute (({txt = "bs.config" | "config"; loc}, payload) as attr);
82-
}
83-
:: _ ->
76+
| {psig_desc = Psig_attribute (({txt = "config"; loc}, payload) as attr)} :: _
77+
->
8478
Bs_ast_invariant.mark_used_bs_attribute attr;
8579
Ext_list.iter
8680
(Ast_payload.ident_or_record_as_config loc payload)

jscomp/frontend/bs_builtin_ppx.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ let structure_item_mapper (self : mapper) (str : Parsetree.structure_item) :
467467
Pstr_value
468468
(Nonrecursive, [{pvb_pat; pvb_expr; pvb_attributes; pvb_loc}]);
469469
})
470-
| Pstr_attribute ({txt = "bs.config" | "config"}, _) -> str
470+
| Pstr_attribute ({txt = "config"}, _) -> str
471471
| _ -> default_mapper.structure_item self str
472472

473473
let local_module_name =

jscomp/ml/ast_payload.mli

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ val assert_strings : Location.t -> t -> string list
6363
(** as a record or empty
6464
it will accept
6565
66-
{[ [@@@bs.config ]]}
66+
{[ [@@@config ]]}
6767
or
68-
{[ [@@@bs.config no_export ] ]}
68+
{[ [@@@config no_export ] ]}
6969
or
70-
{[ [@@@bs.config { property .. } ]]}
70+
{[ [@@@config { property .. } ]]}
7171
Note that we only
7272
{[
7373
{ flat_property}

jscomp/others/belt_List.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
```
6060
*/
6161

62-
@@bs.config({flags: ["-bs-noassertfalse"]})
62+
@@config({flags: ["-bs-noassertfalse"]})
6363

6464
type t<'a> = list<'a>
6565

jscomp/others/belt_internalAVLset.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* You should have received a copy of the GNU Lesser General Public License
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
24-
@@bs.config({flags: ["-bs-noassertfalse"]})
24+
@@config({flags: ["-bs-noassertfalse"]})
2525
type rec node<'value> = {
2626
@as("v") mutable value: 'value,
2727
@as("h") mutable height: int,

jscomp/others/belt_internalAVLtree.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
/* Almost rewritten by authors of ReScript */
1515

16-
@@bs.config({flags: ["-bs-noassertfalse"]})
16+
@@config({flags: ["-bs-noassertfalse"]})
1717
type rec node<'k, 'v> = {
1818
@as("k") mutable key: 'k,
1919
@as("v") mutable value: 'v,

jscomp/others/belt_internalMapInt.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({flags: ["-bs-noassertfalse"]})
1+
@@config({flags: ["-bs-noassertfalse"]})
22

33
type key = int
44

jscomp/others/belt_internalMapString.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({flags: ["-bs-noassertfalse"]})
1+
@@config({flags: ["-bs-noassertfalse"]})
22

33
type key = string
44

jscomp/others/internal_map.cppo.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({flags: ["-bs-noassertfalse"]})
1+
@@config({flags: ["-bs-noassertfalse"]})
22

33
#ifdef TYPE_STRING
44
type key = string

jscomp/others/js.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

25-
[@@@bs.config {flags = [|"-unboxed-types"; "-w"; "-49"|]}]
25+
[@@@config {flags = [|"-unboxed-types"; "-w"; "-49"|]}]
2626
(* DESIGN:
2727
- It does not have any code, all its code will be inlined so that
2828
there will never be

jscomp/others/js_OO.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2424

25-
@@bs.config({flags: ["-unboxed-types"]})
25+
@@config({flags: ["-unboxed-types"]})
2626

2727
external unsafe_to_method: 'a => 'a = "#fn_method"
2828

jscomp/runtime/caml_hash.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* You should have received a copy of the GNU Lesser General Public License
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
24-
@@bs.config({flags: ["-bs-noassertfalse"]})
24+
@@config({flags: ["-bs-noassertfalse"]})
2525
type rec cell<'a> = {
2626
content: 'a,
2727
mutable next: option<cell<'a>>,

jscomp/runtime/js.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

25-
[@@@bs.config {flags = [|"-unboxed-types"; "-w"; "-49"|]}]
25+
[@@@config {flags = [|"-unboxed-types"; "-w"; "-49"|]}]
2626
(* DESIGN:
2727
- It does not have any code, all its code will be inlined so that
2828
there will never be

jscomp/stdlib-406/callback.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/* special exception on linking described in the file LICENSE. */
1313
/* */
1414
/* ************************************************************************ */
15-
@@bs.config({flags: ["-bs-no-cross-module-opt"]})
15+
@@config({flags: ["-bs-no-cross-module-opt"]})
1616
/* Registering OCaml values with the C runtime for later callbacks */
1717

1818
let register = (_, _) => ()

jscomp/stdlib-406/camlinternalLazy.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2424

25-
@@bs.config({flags: ["-bs-no-cross-module-opt"]})
25+
@@config({flags: ["-bs-no-cross-module-opt"]})
2626

2727
/* Internals of forcing lazy values. */
2828
type t<'a> = {

jscomp/stdlib-406/sys.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({flags: ["-bs-no-cross-module-opt"]})
1+
@@config({flags: ["-bs-no-cross-module-opt"]})
22
/* ************************************************************************ */
33
/* */
44
/* OCaml */

jscomp/syntax/tests/idempotency/mareo/Main.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({no_export: no_export})
1+
@@config({no_export: no_export})
22

33
open Belt
44

jscomp/syntax/tests/idempotency/pupilfirst/courses/CoursesCurriculum__SubmissionBuilder.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({jsx: 3})
1+
@@config({jsx: 3})
22

33
open CoursesCurriculum__Types
44

jscomp/syntax/tests/idempotency/pupilfirst/courses/SubmissionChecklistItemShow.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({jsx: 3})
1+
@@config({jsx: 3})
22

33
module ChecklistItem = SubmissionChecklistItem
44

jscomp/syntax/tests/idempotency/pupilfirst/schools/CurriculumEditor__TargetChecklistItemEditor.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({jsx: 3})
1+
@@config({jsx: 3})
22

33
open CurriculumEditor__Types
44

jscomp/syntax/tests/idempotency/reductive/reductiveContext.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({jsx: 3})
1+
@@config({jsx: 3})
22
module type Config = {
33
type state
44
type action

jscomp/syntax/tests/idempotency/reductive/subscription.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({jsx: 3})
1+
@@config({jsx: 3})
22

33
@deriving({jsConverter: newType})
44
type source<'a> = {

jscomp/test/alias_default_value_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({
1+
@@config({
22
flags: ["-bs-jsx", "4"],
33
})
44

jscomp/test/bs_MapInt_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({flags: ["-bs-no-cross-module-opt"]})
1+
@@config({flags: ["-bs-no-cross-module-opt"]})
22
let should = b =>
33
if !b {
44
Js.Exn.raiseError("IMPOSSIBLE")

jscomp/test/config1_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
@@bs.config(no_export)
1+
@@config(no_export)
22

33
let a = 3

jscomp/test/debug_mode_value.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({
1+
@@config({
22
flags: [
33
/* "-drawlambda"; */
44
/* "-dlambda"; */

jscomp/test/gpr_1698_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({no_export: true})
1+
@@config({no_export: true})
22
type value =
33
| Natural(int)
44
| Symbol(string)

jscomp/test/gpr_2682_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@@warning("-22")
2-
/* [@@@bs.config no_export] */
2+
/* [@@@config no_export] */
33
/* let for_each n =
44
([%raw{|
55
for (var key in n){

jscomp/test/gpr_4280_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({flags: [/* "-bs-diagnose" */]})
1+
@@config({flags: [/* "-bs-diagnose" */]})
22
let suites: ref<Mt.pair_suites> = ref(list{})
33
let test_id = ref(0)
44
let eq = (loc, x, y) => Mt.eq_suites(~test_id, ~suites, loc, x, y)

jscomp/test/gpr_459_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({no_export: no_export})
1+
@@config({no_export: no_export})
22

33
let suites: ref<Mt.pair_suites> = ref(list{})
44
let test_id = ref(0)

jscomp/test/include_side_effect.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
@@bs.config({no_export: no_export})
1+
@@config({no_export: no_export})
22
include Side_effect
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config(no_export)
1+
@@config(no_export)
22
/* since it is side effect free , this should generate a dummy file
33
*/
44
include Side_effect_free

jscomp/test/inline_string_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({no_export: no_export})
1+
@@config({no_export: no_export})
22
type t =
33
| A_list
44
| A_hashtable

jscomp/test/jsxv4_newtype.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({
1+
@@config({
22
flags: ["-bs-jsx", "4"],
33
})
44

jscomp/test/key_word_property.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* [@@@bs.config {flags = [|
1+
/* [@@@config {flags = [|
22
"-bs-package-output"; "es6:jscomp/test"
33
|]}]
44
*/

jscomp/test/mario_game.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({flags: ["-w", "a", "-bs-no-bin-annot"]})
1+
@@config({flags: ["-w", "a", "-bs-no-bin-annot"]})
22

33
module Actors: {
44
type dir_1d = Left | Right

jscomp/test/mutable_uncurry_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({
1+
@@config({
22
flags: [
33
/* "-bs-diagnose" */
44
],

jscomp/test/obj_magic_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({
1+
@@config({
22
flags: [
33
/* "-drawlambda" */
44
],

jscomp/test/ocaml_re_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({flags: ["-w", "a", "-bs-no-bin-annot"], no_export})
1+
@@config({flags: ["-w", "a", "-bs-no-bin-annot"], no_export})
22
let suites: ref<Mt.pair_suites> = ref(list{})
33
let test_id = ref(0)
44
let eq = (loc, x, y) => {

jscomp/test/poly_empty_array.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
@@bs.config({flags: ["-bs-unsafe-empty-array"]})
1+
@@config({flags: ["-bs-unsafe-empty-array"]})
22
let a = []

jscomp/test/polyvar_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config(no_export)
1+
@@config(no_export)
22

33
let f = x =>
44
switch x {

jscomp/test/rec_module_opt.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({
1+
@@config({
22
flags: [
33
/* "-drawlambda"; */
44
/* "-dlambda"; */

jscomp/test/record_debug_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* [@@@bs.config {flags = [|"-dsource"|]}] */
1+
/* [@@@config {flags = [|"-dsource"|]}] */
22
let suites: ref<Mt.pair_suites> = ref(list{})
33
let test_id = ref(0)
44
let eq = (loc, x, y) => Mt.eq_suites(~test_id, ~suites, loc, x, y)

jscomp/test/recursive_react_component.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({
1+
@@config({
22
flags: [
33
"-bs-jsx",
44
"3", // "-dsource",

jscomp/test/string_get_set_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({no_export: no_export})
1+
@@config({no_export: no_export})
22
let \".%()" = (s: string, i) => String.get(s, i)
33

44
Mt.from_pair_suites(__FILE__, list{(__LOC__, _ => Eq(\".%()"("h", 0), 'h'))})

jscomp/test/tramp_fib.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({flags: ["-w", "a", "-bs-noassertfalse"]})
1+
@@config({flags: ["-w", "a", "-bs-noassertfalse"]})
22

33
let suites: ref<Mt.pair_suites> = ref(list{})
44
let test_id = ref(0)

jscomp/test/unit_undefined_test.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@bs.config({
1+
@@config({
22
flags: [
33
/* "-bs-diagnose" */
44
/* ; "-drawlambda" */

0 commit comments

Comments
 (0)