Skip to content

Commit a296670

Browse files
committed
Rename @@uncurried.always to simply @@uncurried.
1 parent 3c634f4 commit a296670

File tree

12 files changed

+22
-22
lines changed

12 files changed

+22
-22
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ subset of the arguments, and return a curried type with the remaining ones https
2424
- Add support for default arguments in uncurried functions https://github.com/rescript-lang/rescript-compiler/pull/5835
2525
- Inline uncurried application when it is safe https://github.com/rescript-lang/rescript-compiler/pull/5847
2626
- Support optional named arguments without a final unit in uncurried functions https://github.com/rescript-lang/rescript-compiler/pull/5907
27-
- Add support for uncurried-always: a mode where everything is considered uncurried, whether with or without the `.`. This can be turned on with `@@uncurriedAlways` locally in a file. Added a boolean project config `"uncurried"`, which propagates to dependencies, to turn on uncurried mode.
27+
- Add support for uncurried mode: a mode where everything is considered uncurried, whether with or without the `.`. This can be turned on with `@@uncurried` locally in a file. For project-level configuration in `bsconfig.json`, there's a boolean config `"uncurried"`, which propagates to dependencies, to turn on uncurried mode.
2828
Since there's no syntax for partial application in this new mode, introduce `@res.partial foo(x)` to express partial application. This is temporary and will later have some surface syntax.
2929
Use best effort to determine the config when formatting a file.
3030
https://github.com/rescript-lang/rescript-compiler/pull/5968

jscomp/frontend/ast_config.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ let process_directives str =
4444
| Pstr_attribute ({ txt = "directive" },
4545
PStr [ { pstr_desc = Pstr_eval ({ pexp_desc = Pexp_constant (Pconst_string (d, _)) }, _) } ]) ->
4646
Js_config.directives := !Js_config.directives @ [d]
47-
| Pstr_attribute ({txt = "uncurriedAlways"}, _) -> Config.use_automatic_curried_application := true
47+
| Pstr_attribute ({txt = "uncurried"}, _) -> Config.use_automatic_curried_application := true
4848
| _ -> ())
4949

5050
let rec iter_on_bs_config_str (x : Parsetree.structure) =

jscomp/stdlib-406/pervasivesU.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/* */
1414
/* ************************************************************************ */
1515

16-
@@uncurriedAlways
16+
@@uncurried
1717

1818
/* Internal */
1919
external __unsafe_cast: 'a => 'b = "%identity"

jscomp/stdlib-406/pervasivesU.resi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/* */
1414
/* ************************************************************************ */
1515

16-
@@uncurriedAlways
16+
@@uncurried
1717

1818
" The initially opened module.
1919

jscomp/test/UncurriedAlways.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@uncurriedAlways
1+
@@uncurried
22

33
let foo = (x, y) => x + y
44

jscomp/test/UncurriedPervasives.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
@@uncurriedAlways
1+
@@uncurried
22
let n : _ => unit = ignore // Check that we're pulling in uncurried pervasives

res_syntax/src/res_core.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6411,8 +6411,8 @@ and parseStandaloneAttribute p =
64116411
| "uncurried.swap" ->
64126412
p.uncurried_config <- Res_uncurried.Swap;
64136413
attrId
6414-
| "uncurriedAlways" ->
6415-
p.uncurried_config <- Res_uncurried.Always;
6414+
| "uncurried" ->
6415+
p.uncurried_config <- Res_uncurried.Uncurried;
64166416
attrId
64176417
| _ -> attrId
64186418
in

res_syntax/src/res_multi_printer.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
let defaultPrintWidth = 100
22

3-
(* Determine if the file is in uncurried-always mode by looking for
4-
the fist ancestor .bsconfig and see if it contains "uncurry": "default" *)
5-
let getUncurriedAlwaysFromBsconfig ~filename =
3+
(* Determine if the file is in uncurried mode by looking for
4+
the fist ancestor .bsconfig and see if it contains "uncurried": "true" *)
5+
let getUncurriedFromBsconfig ~filename =
66
let rec findBsconfig ~dir =
77
let bsconfig = Filename.concat dir "bsconfig.json" in
88
if Sys.file_exists bsconfig then Some (Res_io.readFile ~filename:bsconfig)
@@ -38,18 +38,18 @@ let getUncurriedAlwaysFromBsconfig ~filename =
3838
| None -> ()
3939
| Some bsconfig ->
4040
let lines = bsconfig |> String.split_on_char '\n' in
41-
let uncurriedAlways =
41+
let uncurried =
4242
lines
4343
|> List.exists (fun line ->
4444
let words = line |> String.split_on_char '\"' in
4545
words |> List.exists (fun word -> word = "uncurried")
4646
&& words |> List.exists (fun word -> word = "true"))
4747
in
48-
if uncurriedAlways then Res_uncurried.init := Always
48+
if uncurried then Res_uncurried.init := Uncurried
4949

5050
(* print res files to res syntax *)
5151
let printRes ~ignoreParseErrors ~isInterface ~filename =
52-
getUncurriedAlwaysFromBsconfig ~filename;
52+
getUncurriedFromBsconfig ~filename;
5353
if isInterface then (
5454
let parseResult =
5555
Res_driver.parsingEngine.parseInterface ~forPrinter:true ~filename

res_syntax/src/res_printer.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5279,8 +5279,8 @@ and printAttribute ?(standalone = false) ~state
52795279
| "uncurried.swap" ->
52805280
state.uncurried_config <- Res_uncurried.Swap;
52815281
id
5282-
| "uncurriedAlways" ->
5283-
state.uncurried_config <- Res_uncurried.Always;
5282+
| "uncurried" ->
5283+
state.uncurried_config <- Res_uncurried.Uncurried;
52845284
id
52855285
| _ -> id
52865286
in

res_syntax/src/res_uncurried.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
type config = Legacy | Swap | Always
1+
type config = Legacy | Swap | Uncurried
22

33
let init = ref Legacy
44

55
let isSwap = function
66
| Legacy -> false
77
| Swap -> true
8-
| Always -> true
8+
| Uncurried -> true
99

1010
(* For parsing *)
1111
let fromDotted ~dotted = function
1212
| Legacy -> dotted
1313
| Swap -> not dotted
14-
| Always -> true
14+
| Uncurried -> true
1515

1616
(* For printing *)
1717
let getDotted ~uncurried = function
1818
| Legacy -> uncurried
1919
| Swap -> not uncurried
20-
| Always -> false
20+
| Uncurried -> false

res_syntax/tests/parsing/grammar/expressions/UncurriedAlways.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@uncurriedAlways
1+
@@uncurried
22

33
let foo = (x, y) => x + y
44

res_syntax/tests/parsing/grammar/expressions/expected/UncurriedAlways.res.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@@@uncurriedAlways ]
1+
[@@@uncurried ]
22
let foo = ((Function$ (fun x -> fun y -> x + y))[@res.arity 2])
33
let z = ((foo 3 4)[@res.uapp ])
44
let bar = ((Function$ (fun x -> fun y -> x + y))[@res.arity 2])

0 commit comments

Comments
 (0)