Skip to content

Commit 851fcab

Browse files
committed
Ignore -uncurried compiler flag.
1 parent 7d6b8d9 commit 851fcab

File tree

206 files changed

+3084
-2167
lines changed

Some content is hidden

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

206 files changed

+3084
-2167
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
- Avoid generating calls to Curry when adjusting arity of uncurried functions. https://github.com/rescript-lang/rescript-compiler/pull/6870
6767
- Remove `@@uncurried.swap`, which was used for internal tests. https://github.com/rescript-lang/rescript-compiler/pull/6875
6868
- Build the compiler libraries/tests in uncurried mode. https://github.com/rescript-lang/rescript-compiler/pull/6864
69+
- Ignore `-uncurried` command-line flag. https://github.com/rescript-lang/rescript-compiler/pull/6885
6970

7071
#### :nail_care: Polish
7172

jscomp/bsc/rescript_compiler_main.ml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ let process_file sourcefile ?(kind ) ppf =
4040
The {!Location.input_name} relies on that we write the binary ast
4141
properly
4242
*)
43-
let uncurried = !Config.uncurried in
4443
setup_outcome_printer ();
4544
let kind =
4645
match kind with
@@ -78,11 +77,9 @@ let process_file sourcefile ?(kind ) ppf =
7877
| Unknown ->
7978
Bsc_args.bad_arg ("don't know what to do with " ^ sourcefile)
8079
in
81-
Config.uncurried := uncurried;
8280
res
8381

8482
let reprint_source_file sourcefile =
85-
let uncurried = !Config.uncurried in
8683
let kind = Ext_file_extensions.classify_input (Ext_filename.get_extension_maybe sourcefile) in
8784
let sourcefile = set_abs_input_name sourcefile in
8885
let res = match kind with
@@ -119,7 +116,6 @@ let reprint_source_file sourcefile =
119116
print_endline ("Invalid input for reprinting ReScript source. Must be a ReScript file: " ^ sourcefile);
120117
exit 2
121118
in
122-
Config.uncurried := uncurried;
123119
res
124120

125121
let usage = "Usage: bsc <options> <files>\nOptions are:"
@@ -406,8 +402,8 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array =
406402

407403
"-nopervasives", set Clflags.nopervasives,
408404
"*internal*";
409-
"-uncurried", unit_call (fun () -> Config.uncurried := Uncurried),
410-
"*internal* Set jsx module";
405+
"-uncurried", unit_call (fun () -> ()),
406+
"*internal* deprecated";
411407
"-v", unit_call print_version_string,
412408
"Print compiler version and location of standard library and exit";
413409

jscomp/build_tests/super_errors/expected/warnings3.res.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
2 │ let _ = string_of_float(34.)
77
3 │ let _ = string_of_float(34.)
88

9-
deprecated: PervasivesU.string_of_float
9+
deprecated: Pervasives.string_of_float
1010
Please use Js.Float.toString instead, string_of_float generates unparseable floats
1111

1212

@@ -18,7 +18,7 @@
1818
3 │ let _ = string_of_float(34.)
1919
4 │
2020

21-
deprecated: PervasivesU.string_of_float
21+
deprecated: Pervasives.string_of_float
2222
Please use Js.Float.toString instead, string_of_float generates unparseable floats
2323

2424

@@ -30,5 +30,5 @@
3030
3 │ let _ = string_of_float(34.)
3131
4 │
3232

33-
deprecated: PervasivesU.string_of_float
33+
deprecated: Pervasives.string_of_float
3434
Please use Js.Float.toString instead, string_of_float generates unparseable floats

jscomp/build_tests/uncurried_printer/input.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

jscomp/build_tests/uncurried_printer/rescript.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

jscomp/build_tests/uncurried_printer/src/a.res

Lines changed: 0 additions & 1 deletion
This file was deleted.

jscomp/core/res_compmisc.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ let initial_env ?(modulename) () =
5353
let initial = Env.initial_safe_string in
5454
let env =
5555
if !Clflags.nopervasives then initial
56-
else open_implicit_module (if !Config.uncurried = Uncurried then "PervasivesU" else "Pervasives") initial
56+
else open_implicit_module "Pervasives" initial
5757
in
5858
List.fold_left
5959
(fun env m -> open_implicit_module m env)

jscomp/ext/config.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ let bs_only = ref true
1212
let unsafe_empty_array = ref false
1313

1414
type uncurried = Legacy | Uncurried
15-
let uncurried = ref Legacy
1615

17-
and cmi_magic_number = "Caml1999I022"
16+
let cmi_magic_number = "Caml1999I022"
1817

1918
and ast_impl_magic_number = "Caml1999M022"
2019

jscomp/ext/config.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,3 @@ val cmt_magic_number : string
4343
val print_config : out_channel -> unit
4444

4545
type uncurried = Legacy | Uncurried
46-
val uncurried : uncurried ref

jscomp/frontend/ast_attributes.ml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,13 @@ let iter_process_bs_string_int_unwrap_uncurry (attrs : t) =
188188
st := v)
189189
else Bs_syntaxerr.err loc Conflict_attributes
190190
in
191-
Ext_list.iter attrs (fun (({txt; loc = _}, (payload : _)) as attr) ->
191+
Ext_list.iter attrs (fun (({txt; loc = _}, _) as attr) ->
192192
match txt with
193193
| "string" -> assign `String attr
194194
| "int" -> assign `Int attr
195195
| "ignore" -> assign `Ignore attr
196196
| "unwrap" -> assign `Unwrap attr
197-
| "uncurry" ->
198-
if !Config.uncurried = Uncurried then
199-
Used_attributes.mark_used_attribute attr
200-
else assign (`Uncurry (Ast_payload.is_single_int payload)) attr
197+
| "uncurry" -> Used_attributes.mark_used_attribute attr
201198
| _ -> ());
202199
!st
203200

0 commit comments

Comments
 (0)