From a1084f3af700c53257be33952f8e1c4c0a9905ee Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sat, 19 Aug 2023 09:02:54 +0200 Subject: [PATCH 1/2] Replace most remaining occurrences of "BuckleScript" with "ReScript" --- jscomp/build_tests/case/src/demo.res | 2 +- jscomp/build_tests/case2/package.json | 2 +- jscomp/build_tests/case2/src/X.res | 2 +- jscomp/build_tests/case3/package.json | 2 +- .../build_tests/custom_namespace/package.json | 2 +- jscomp/build_tests/cycle/package.json | 2 +- jscomp/build_tests/devonly/package.json | 2 +- .../a/package.json | 2 +- .../b/package.json | 2 +- .../c/package.json | 2 +- .../package.json | 2 +- jscomp/build_tests/exports/package.json | 2 +- jscomp/build_tests/hyphen2/package.json | 2 +- jscomp/build_tests/hyphen2/y-src/demo.res | 2 +- jscomp/build_tests/install/package.json | 2 +- jscomp/build_tests/nested/package.json | 2 +- jscomp/build_tests/nnest/package.json | 2 +- jscomp/build_tests/ns/package.json | 2 +- jscomp/build_tests/post-build/package.json | 2 +- jscomp/build_tests/post-build/src/demo.res | 2 +- .../react_ppx/src/gpr_3987_test.bs.js | 24 +++++++++---------- .../react_ppx/src/gpr_3987_test.res | 12 +++++----- jscomp/build_tests/rerror/README.md | 2 +- jscomp/build_tests/rerror/bsconfig.json | 3 --- jscomp/build_tests/rerror/package.json | 2 +- jscomp/build_tests/unicode/.merlin | 12 ---------- jscomp/build_tests/weird_deps/package.json | 2 +- jscomp/build_tests/weird_deps/src/demo.res | 2 +- jscomp/build_tests/weird_devdeps/package.json | 2 +- jscomp/build_tests/weird_devdeps/src/demo.res | 2 +- jscomp/build_tests/weird_names/package.json | 2 +- jscomp/build_tests/x-y/package.json | 2 +- jscomp/build_tests/x-y/x-src/demo.res | 2 +- jscomp/build_tests/zerocycle/package.json | 2 +- jscomp/ext/ext_path.ml | 10 ++++---- jscomp/gentype/GenTypeMain.ml | 6 ++--- jscomp/gentype/Runtime.ml | 2 +- jscomp/gentype/TranslateStructure.ml | 2 +- jscomp/gentype/TranslateTypeExprFromTypes.ml | 2 +- .../src/nested/Types.res | 2 +- jscomp/others/js_json.resi | 4 ++-- jscomp/others/js_string.res | 16 ++++++------- jscomp/others/js_string2.res | 16 ++++++------- jscomp/ounit_tests/ounit_bsb_regex_tests.ml | 4 ++-- .../tests/idempotency/genType/src/EmitJs.res | 2 +- .../idempotency/genType/src/ModuleName.res | 2 +- .../idempotency/genType/src/ModuleName.resi | 2 +- .../tests/idempotency/genType/src/Runtime.res | 4 ++-- .../wildcards-world-ui/LazyThreeBoxUpdate.res | 4 ++-- .../comments/expected/multiline.res.txt | 2 +- .../tests/printer/comments/multiline.res | 2 +- jscomp/test/reactDOMRe.res | 4 ++-- 52 files changed, 90 insertions(+), 107 deletions(-) delete mode 100644 jscomp/build_tests/unicode/.merlin diff --git a/jscomp/build_tests/case/src/demo.res b/jscomp/build_tests/case/src/demo.res index 9af096591d..8d0b19151f 100644 --- a/jscomp/build_tests/case/src/demo.res +++ b/jscomp/build_tests/case/src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, BuckleScript") +let () = Js.log("Hello, ReScript") diff --git a/jscomp/build_tests/case2/package.json b/jscomp/build_tests/case2/package.json index a082d7015b..3ce2aa8b03 100644 --- a/jscomp/build_tests/case2/package.json +++ b/jscomp/build_tests/case2/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "license": "MIT", "devDependencies": { diff --git a/jscomp/build_tests/case2/src/X.res b/jscomp/build_tests/case2/src/X.res index 9af096591d..8d0b19151f 100644 --- a/jscomp/build_tests/case2/src/X.res +++ b/jscomp/build_tests/case2/src/X.res @@ -1 +1 @@ -let () = Js.log("Hello, BuckleScript") +let () = Js.log("Hello, ReScript") diff --git a/jscomp/build_tests/case3/package.json b/jscomp/build_tests/case3/package.json index 0c46a3dfde..822bff18fc 100644 --- a/jscomp/build_tests/case3/package.json +++ b/jscomp/build_tests/case3/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "author": "", "license": "MIT", diff --git a/jscomp/build_tests/custom_namespace/package.json b/jscomp/build_tests/custom_namespace/package.json index ff3881a660..4b2cc1a09d 100644 --- a/jscomp/build_tests/custom_namespace/package.json +++ b/jscomp/build_tests/custom_namespace/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "license": "MIT", "devDependencies": { diff --git a/jscomp/build_tests/cycle/package.json b/jscomp/build_tests/cycle/package.json index 488bf6bcd2..ddbb784aa3 100644 --- a/jscomp/build_tests/cycle/package.json +++ b/jscomp/build_tests/cycle/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "author": "", "license": "MIT", diff --git a/jscomp/build_tests/devonly/package.json b/jscomp/build_tests/devonly/package.json index 18aeaf4fa2..53a3ef8226 100644 --- a/jscomp/build_tests/devonly/package.json +++ b/jscomp/build_tests/devonly/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "author": "", "license": "MIT", diff --git a/jscomp/build_tests/duplicated_symlinked_packages/a/package.json b/jscomp/build_tests/duplicated_symlinked_packages/a/package.json index 3bfbac807f..f0cb45e231 100644 --- a/jscomp/build_tests/duplicated_symlinked_packages/a/package.json +++ b/jscomp/build_tests/duplicated_symlinked_packages/a/package.json @@ -7,7 +7,7 @@ "clean": "rescript clean" }, "keywords": [ - "BuckleScript" + "ReScript" ], "author": "", "license": "MIT", diff --git a/jscomp/build_tests/duplicated_symlinked_packages/b/package.json b/jscomp/build_tests/duplicated_symlinked_packages/b/package.json index 21032b3ede..6cba4e4ddc 100644 --- a/jscomp/build_tests/duplicated_symlinked_packages/b/package.json +++ b/jscomp/build_tests/duplicated_symlinked_packages/b/package.json @@ -7,7 +7,7 @@ "clean": "rescript clean" }, "keywords": [ - "BuckleScript" + "ReScript" ], "author": "", "license": "MIT", diff --git a/jscomp/build_tests/duplicated_symlinked_packages/c/package.json b/jscomp/build_tests/duplicated_symlinked_packages/c/package.json index 0eb39d1031..907967c8be 100644 --- a/jscomp/build_tests/duplicated_symlinked_packages/c/package.json +++ b/jscomp/build_tests/duplicated_symlinked_packages/c/package.json @@ -7,7 +7,7 @@ "clean": "rescript clean" }, "keywords": [ - "BuckleScript" + "ReScript" ], "author": "", "license": "MIT", diff --git a/jscomp/build_tests/duplicated_symlinked_packages/package.json b/jscomp/build_tests/duplicated_symlinked_packages/package.json index 365f79e5cc..c4d0718c53 100644 --- a/jscomp/build_tests/duplicated_symlinked_packages/package.json +++ b/jscomp/build_tests/duplicated_symlinked_packages/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "license": "MIT", "devDependencies": { diff --git a/jscomp/build_tests/exports/package.json b/jscomp/build_tests/exports/package.json index 8ee100cf4d..6a6682cecd 100644 --- a/jscomp/build_tests/exports/package.json +++ b/jscomp/build_tests/exports/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "license": "MIT", "devDependencies": { diff --git a/jscomp/build_tests/hyphen2/package.json b/jscomp/build_tests/hyphen2/package.json index 28ed7a112e..46c9f7ebcc 100644 --- a/jscomp/build_tests/hyphen2/package.json +++ b/jscomp/build_tests/hyphen2/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "license": "MIT", "devDependencies": { diff --git a/jscomp/build_tests/hyphen2/y-src/demo.res b/jscomp/build_tests/hyphen2/y-src/demo.res index 9af096591d..8d0b19151f 100644 --- a/jscomp/build_tests/hyphen2/y-src/demo.res +++ b/jscomp/build_tests/hyphen2/y-src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, BuckleScript") +let () = Js.log("Hello, ReScript") diff --git a/jscomp/build_tests/install/package.json b/jscomp/build_tests/install/package.json index 7ed8983cb4..0e8e9b368b 100644 --- a/jscomp/build_tests/install/package.json +++ b/jscomp/build_tests/install/package.json @@ -8,7 +8,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "author": "", "license": "MIT", diff --git a/jscomp/build_tests/nested/package.json b/jscomp/build_tests/nested/package.json index 9aa6fb8598..06ac12c203 100644 --- a/jscomp/build_tests/nested/package.json +++ b/jscomp/build_tests/nested/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "license": "MIT", "devDependencies": { diff --git a/jscomp/build_tests/nnest/package.json b/jscomp/build_tests/nnest/package.json index 9aa6fb8598..06ac12c203 100644 --- a/jscomp/build_tests/nnest/package.json +++ b/jscomp/build_tests/nnest/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "license": "MIT", "devDependencies": { diff --git a/jscomp/build_tests/ns/package.json b/jscomp/build_tests/ns/package.json index b3a92351f4..e9d0604003 100644 --- a/jscomp/build_tests/ns/package.json +++ b/jscomp/build_tests/ns/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "license": "MIT", "devDependencies": { diff --git a/jscomp/build_tests/post-build/package.json b/jscomp/build_tests/post-build/package.json index 2ad2b88c93..0014b77f78 100644 --- a/jscomp/build_tests/post-build/package.json +++ b/jscomp/build_tests/post-build/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "author": "", "license": "MIT", diff --git a/jscomp/build_tests/post-build/src/demo.res b/jscomp/build_tests/post-build/src/demo.res index 9af096591d..8d0b19151f 100644 --- a/jscomp/build_tests/post-build/src/demo.res +++ b/jscomp/build_tests/post-build/src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, BuckleScript") +let () = Js.log("Hello, ReScript") diff --git a/jscomp/build_tests/react_ppx/src/gpr_3987_test.bs.js b/jscomp/build_tests/react_ppx/src/gpr_3987_test.bs.js index 9144226068..aee858b0cf 100644 --- a/jscomp/build_tests/react_ppx/src/gpr_3987_test.bs.js +++ b/jscomp/build_tests/react_ppx/src/gpr_3987_test.bs.js @@ -28,7 +28,7 @@ function make(_props) { return null; } -var BuckleScript3987ReproOk = { +var Gpr3987ReproOk = { makeProps: makeProps, make: make }; @@ -37,30 +37,30 @@ React.createElement(make, makeProps("test", (function (param, param$1) { }), undefined)); -function Gpr_3987_test$BuckleScript3987ReproOk2(Props) { +function Gpr_3987_test$Gpr3987ReproOk2(Props) { return null; } -var BuckleScript3987ReproOk2 = { - make: Gpr_3987_test$BuckleScript3987ReproOk2 +var Gpr3987ReproOk2 = { + make: Gpr_3987_test$Gpr3987ReproOk2 }; -React.createElement(Gpr_3987_test$BuckleScript3987ReproOk2, { +React.createElement(Gpr_3987_test$Gpr3987ReproOk2, { value: "test", onChange: (function (param, param$1) { }) }); -function Gpr_3987_test$BuckleScript3987ReproError(Props) { +function Gpr_3987_test$Gpr3987ReproError(Props) { return null; } -var BuckleScript3987ReproError = { - make: Gpr_3987_test$BuckleScript3987ReproError +var Gpr3987ReproError = { + make: Gpr_3987_test$Gpr3987ReproError }; -React.createElement(Gpr_3987_test$BuckleScript3987ReproError, { +React.createElement(Gpr_3987_test$Gpr3987ReproError, { value: "test", onChange: (function (param, param$1) { @@ -68,7 +68,7 @@ React.createElement(Gpr_3987_test$BuckleScript3987ReproError, { }); exports.makeContainer = makeContainer; -exports.BuckleScript3987ReproOk = BuckleScript3987ReproOk; -exports.BuckleScript3987ReproOk2 = BuckleScript3987ReproOk2; -exports.BuckleScript3987ReproError = BuckleScript3987ReproError; +exports.Gpr3987ReproOk = Gpr3987ReproOk; +exports.Gpr3987ReproOk2 = Gpr3987ReproOk2; +exports.Gpr3987ReproError = Gpr3987ReproError; /* Not a pure module */ diff --git a/jscomp/build_tests/react_ppx/src/gpr_3987_test.res b/jscomp/build_tests/react_ppx/src/gpr_3987_test.res index 91dc6fed96..de195e3596 100644 --- a/jscomp/build_tests/react_ppx/src/gpr_3987_test.res +++ b/jscomp/build_tests/react_ppx/src/gpr_3987_test.res @@ -23,29 +23,29 @@ let makeContainer = text => { } /* This uncurried prop definition compiles */ -module BuckleScript3987ReproOk = { +module Gpr3987ReproOk = { let makeProps = (~value: string, ~onChange: (. string, int) => unit, ()) => {"value": value, "onChange": onChange} let make = (_props: {"value": string, "onChange": (. string, int) => unit}) => React.null } -let _ = ()} /> +let _ = ()} /> /* Extracted type for the uncurried prop compiles as well */ -module BuckleScript3987ReproOk2 = { +module Gpr3987ReproOk2 = { type onChange = (. string, int) => unit @react.component let make = (~value as _, ~onChange as _: onChange) => React.null } -let _ = ()} /> +let _ = ()} /> /* Inline uncurried prop type causes an error */ -module BuckleScript3987ReproError = { +module Gpr3987ReproError = { @react.component let make = (~value as _: string, ~onChange as _: (. string, int) => unit) => React.null } -let _ = ()} /> +let _ = ()} /> diff --git a/jscomp/build_tests/rerror/README.md b/jscomp/build_tests/rerror/README.md index 855f884f43..ce122ba93a 100644 --- a/jscomp/build_tests/rerror/README.md +++ b/jscomp/build_tests/rerror/README.md @@ -1,6 +1,6 @@ # Basic Reason Template -Hello! This project allows you to quickly get started with Reason and BuckleScript. If you wanted a more sophisticated version, try the `react` template (`rescript -theme react -init .`). +Hello! This project allows you to quickly get started with ReScript. If you wanted a more sophisticated version, try the `react` template (`rescript -theme react -init .`). # Build ``` diff --git a/jscomp/build_tests/rerror/bsconfig.json b/jscomp/build_tests/rerror/bsconfig.json index da419e5ea8..8e8f743e8c 100644 --- a/jscomp/build_tests/rerror/bsconfig.json +++ b/jscomp/build_tests/rerror/bsconfig.json @@ -1,5 +1,3 @@ -// This is the configuration file used by BuckleScript's build system rescript. Its documentation lives here: http://bucklescript.github.io/bucklescript/docson/#build-schema.json -// BuckleScript comes with its own parser for bsconfig.json, which is normal JSON, with the extra support of comments and trailing commas. { "name": "rerror", "version": "0.1.0", @@ -7,6 +5,5 @@ "src" ], "bs-dependencies" : [ - // add your dependencies here. You'd usually install them normally through `npm install my-dependency`. If my-dependency has a bsconfig.json too, then everything will work seamlessly. ] } diff --git a/jscomp/build_tests/rerror/package.json b/jscomp/build_tests/rerror/package.json index 36908590fb..d7dd0ae692 100644 --- a/jscomp/build_tests/rerror/package.json +++ b/jscomp/build_tests/rerror/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "license": "MIT", "devDependencies": { diff --git a/jscomp/build_tests/unicode/.merlin b/jscomp/build_tests/unicode/.merlin deleted file mode 100644 index 3836737796..0000000000 --- a/jscomp/build_tests/unicode/.merlin +++ /dev/null @@ -1,12 +0,0 @@ -####{BSB GENERATED: NO EDIT -FLG -ppx '/Users/hongbozhang/git/bucklescript/darwin/bsc.exe -as-ppx ' -S /Users/hongbozhang/git/bucklescript/jscomp/build_tests/node_modules/bs-platform/lib/ocaml -B /Users/hongbozhang/git/bucklescript/jscomp/build_tests/node_modules/bs-platform/lib/ocaml -FLG -w +a-4-9-40-41-42-50-61-102 -S 📕annotation -B lib/bs/📕annotation -S 📗block -B lib/bs/📗block -S 📙inline -B lib/bs/📙inline -####BSB GENERATED: NO EDIT} diff --git a/jscomp/build_tests/weird_deps/package.json b/jscomp/build_tests/weird_deps/package.json index 7c028a9906..803fefcbf0 100644 --- a/jscomp/build_tests/weird_deps/package.json +++ b/jscomp/build_tests/weird_deps/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "author": "", "license": "MIT" diff --git a/jscomp/build_tests/weird_deps/src/demo.res b/jscomp/build_tests/weird_deps/src/demo.res index 9af096591d..8d0b19151f 100644 --- a/jscomp/build_tests/weird_deps/src/demo.res +++ b/jscomp/build_tests/weird_deps/src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, BuckleScript") +let () = Js.log("Hello, ReScript") diff --git a/jscomp/build_tests/weird_devdeps/package.json b/jscomp/build_tests/weird_devdeps/package.json index b7116d34eb..1b702b052c 100644 --- a/jscomp/build_tests/weird_devdeps/package.json +++ b/jscomp/build_tests/weird_devdeps/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "author": "", "license": "MIT" diff --git a/jscomp/build_tests/weird_devdeps/src/demo.res b/jscomp/build_tests/weird_devdeps/src/demo.res index 9af096591d..8d0b19151f 100644 --- a/jscomp/build_tests/weird_devdeps/src/demo.res +++ b/jscomp/build_tests/weird_devdeps/src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, BuckleScript") +let () = Js.log("Hello, ReScript") diff --git a/jscomp/build_tests/weird_names/package.json b/jscomp/build_tests/weird_names/package.json index 4759556a0c..c74121e355 100644 --- a/jscomp/build_tests/weird_names/package.json +++ b/jscomp/build_tests/weird_names/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "author": "", "license": "MIT", diff --git a/jscomp/build_tests/x-y/package.json b/jscomp/build_tests/x-y/package.json index b614a74983..bf41baff58 100644 --- a/jscomp/build_tests/x-y/package.json +++ b/jscomp/build_tests/x-y/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "license": "MIT", "devDependencies": { diff --git a/jscomp/build_tests/x-y/x-src/demo.res b/jscomp/build_tests/x-y/x-src/demo.res index 9af096591d..8d0b19151f 100644 --- a/jscomp/build_tests/x-y/x-src/demo.res +++ b/jscomp/build_tests/x-y/x-src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, BuckleScript") +let () = Js.log("Hello, ReScript") diff --git a/jscomp/build_tests/zerocycle/package.json b/jscomp/build_tests/zerocycle/package.json index 0329044793..85dd9a9890 100644 --- a/jscomp/build_tests/zerocycle/package.json +++ b/jscomp/build_tests/zerocycle/package.json @@ -7,7 +7,7 @@ "watch": "rescript build -w" }, "keywords": [ - "BuckleScript" + "ReScript" ], "author": "", "license": "MIT", diff --git a/jscomp/ext/ext_path.ml b/jscomp/ext/ext_path.ml index 9ad999077e..6b1ec82e8d 100644 --- a/jscomp/ext/ext_path.ml +++ b/jscomp/ext/ext_path.ml @@ -43,18 +43,18 @@ let split_by_sep_per_os : string -> string list = (** example {[ - "/bb/mbigc/mbig2899/bgit/bucklescript/jscomp/stdlib/external/pervasives.cmj" - "/bb/mbigc/mbig2899/bgit/bucklescript/jscomp/stdlib/ocaml_array.ml" + "/bb/mbigc/mbig2899/bgit/rescript/jscomp/stdlib/external/pervasives.cmj" + "/bb/mbigc/mbig2899/bgit/rescript/jscomp/stdlib/ocaml_array.ml" ]} The other way {[ - "/bb/mbigc/mbig2899/bgit/bucklescript/jscomp/stdlib/ocaml_array.ml" - "/bb/mbigc/mbig2899/bgit/bucklescript/jscomp/stdlib/external/pervasives.cmj" + "/bb/mbigc/mbig2899/bgit/rescript/jscomp/stdlib/ocaml_array.ml" + "/bb/mbigc/mbig2899/bgit/rescript/jscomp/stdlib/external/pervasives.cmj" ]} {[ - "/bb/mbigc/mbig2899/bgit/bucklescript/jscomp/stdlib//ocaml_array.ml" + "/bb/mbigc/mbig2899/bgit/rescript/jscomp/stdlib//ocaml_array.ml" ]} {[ /a/b diff --git a/jscomp/gentype/GenTypeMain.ml b/jscomp/gentype/GenTypeMain.ml index e4bcaf0346..ce2f320158 100644 --- a/jscomp/gentype/GenTypeMain.ml +++ b/jscomp/gentype/GenTypeMain.ml @@ -87,10 +87,8 @@ let readCmt cmtFile = with Cmi_format.Error _ -> Log_.item "Error loading %s\n\n" cmtFile; Log_.item - "It looks like you might be using an old version of Bucklescript, or \ - have stale compilation artifacts.\n"; - Log_.item "Check that bs-platform is version 6.2.x or later.\n"; - Log_.item "And try to clean and rebuild.\n\n"; + "It looks like you might have stale compilation artifacts.\n"; + Log_.item "Try to clean and rebuild.\n\n"; assert false let processCmtFile cmt = diff --git a/jscomp/gentype/Runtime.ml b/jscomp/gentype/Runtime.ml index 9fef385103..102ef3538e 100644 --- a/jscomp/gentype/Runtime.ml +++ b/jscomp/gentype/Runtime.ml @@ -113,7 +113,7 @@ module Mangle = struct keywords |> Array.iter (fun x -> Hashtbl.add table ("_" ^ x) x) (** - Apply bucklescript's mangling rules for object field names: + Apply ReScript's mangling rules for object field names: Remove trailing "__" if present. Otherwise remove leading "_" when followed by an uppercase letter, or keyword. *) diff --git a/jscomp/gentype/TranslateStructure.ml b/jscomp/gentype/TranslateStructure.ml index ef55da7224..b6eb3e8f2a 100644 --- a/jscomp/gentype/TranslateStructure.ml +++ b/jscomp/gentype/TranslateStructure.ml @@ -288,7 +288,7 @@ and translateStructureItem ~config ~outputFileRelative ~resolver ~typeEnv |> Translation.combine | { str_desc = - (* Bucklescript's encoding of bs.module: include with constraint. *) + (* ReScript's encoding of bs.module: include with constraint. *) Tstr_include { incl_mod = diff --git a/jscomp/gentype/TranslateTypeExprFromTypes.ml b/jscomp/gentype/TranslateTypeExprFromTypes.ml index 0e50ae19c9..a0c563e409 100644 --- a/jscomp/gentype/TranslateTypeExprFromTypes.ml +++ b/jscomp/gentype/TranslateTypeExprFromTypes.ml @@ -393,7 +393,7 @@ and translateTypeExprFromTypes_ ~config ~typeVarsGen ~typeEnv in {dependencies = []; type_} | {noPayloads = []; payloads = [(_label, t)]; unknowns = []} -> - (* Handle bucklescript's "Arity_" encoding in first argument of Js.Internal.fn(_,_) for uncurried functions. + (* Handle ReScript's "Arity_" encoding in first argument of Js.Internal.fn(_,_) for uncurried functions. Return the argument tuple. *) t |> translateTypeExprFromTypes_ ~config ~typeVarsGen ~typeEnv | {noPayloads; payloads; unknowns = []} -> diff --git a/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res b/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res index 7c5329d4dc..189f4064bf 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res +++ b/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res @@ -79,7 +79,7 @@ type record = { @genType let testConvertLocation = (x: Location.t) => x -/* Bucklescript's marshaling rules. */ +/* ReScript's marshaling rules. */ @genType type marshalFields = { "_rec": string, diff --git a/jscomp/others/js_json.resi b/jscomp/others/js_json.resi index 6c0163d43f..3063bc90ff 100644 --- a/jscomp/others/js_json.resi +++ b/jscomp/others/js_json.resi @@ -197,7 +197,7 @@ Returns the string representation of a given JSON data structure. let dict = Js.Dict.empty() Js.Dict.set(dict, "name", Js.Json.string("John Doe")) Js.Dict.set(dict, "age", Js.Json.number(30.0)) -Js.Dict.set(dict, "likes", Js.Json.stringArray(["bucklescript", "ocaml", "js"])) +Js.Dict.set(dict, "likes", Js.Json.stringArray(["ReScript", "ocaml", "js"])) Js.log(Js.Json.stringify(Js.Json.object_(dict))) ``` @@ -218,7 +218,7 @@ Returns the string representation of a given JSON data structure with spacing. let dict = Js.Dict.empty() Js.Dict.set(dict, "name", Js.Json.string("John Doe")) Js.Dict.set(dict, "age", Js.Json.number(30.0)) -Js.Dict.set(dict, "likes", Js.Json.stringArray(["bucklescript", "ocaml", "js"])) +Js.Dict.set(dict, "likes", Js.Json.stringArray(["ReScript", "ocaml", "js"])) Js.log(Js.Json.stringifyWithSpace(Js.Json.object_(dict), 2)) ``` diff --git a/jscomp/others/js_string.res b/jscomp/others/js_string.res index a4cb4ec4ce..6f1860c0b9 100644 --- a/jscomp/others/js_string.res +++ b/jscomp/others/js_string.res @@ -218,8 +218,8 @@ See [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/ on MDN. ```res example -Js.String.endsWith("Script", "BuckleScript") == true -Js.String.endsWith("Script", "BuckleShoes") == false +Js.String.endsWith("Script", "ReScript") == true +Js.String.endsWith("Script", "C++") == false ``` */ external endsWith: t => bool = "endsWith" @@ -697,9 +697,9 @@ See [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScrip on MDN. ```res example -Js.String.startsWith("Buckle", "BuckleScript") == true -Js.String.startsWith("", "BuckleScript") == true -Js.String.startsWith("Buckle", "JavaScript") == false +Js.String.startsWith("Re", "ReScript") == true +Js.String.startsWith("", "ReScript") == true +Js.String.startsWith("Re", "JavaScript") == false ``` */ external startsWith: t => bool = "startsWith" @@ -714,9 +714,9 @@ See [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScrip on MDN. ```res example -Js.String.startsWithFrom("kle", 3, "BuckleScript") == true -Js.String.startsWithFrom("", 3, "BuckleScript") == true -Js.String.startsWithFrom("Buckle", 2, "JavaScript") == false +Js.String.startsWithFrom("Scri", 2, "ReScript") == true +Js.String.startsWithFrom("", 2, "ReScript") == true +Js.String.startsWithFrom("Scri", 2, "JavaScript") == false ``` */ external startsWithFrom: (t, int) => bool = "startsWith" diff --git a/jscomp/others/js_string2.res b/jscomp/others/js_string2.res index 2d384fcbae..638e9f0774 100644 --- a/jscomp/others/js_string2.res +++ b/jscomp/others/js_string2.res @@ -223,8 +223,8 @@ See [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/ on MDN. ```res example -Js.String2.endsWith("BuckleScript", "Script") == true -Js.String2.endsWith("BuckleShoes", "Script") == false +Js.String2.endsWith("ReScript", "Script") == true +Js.String2.endsWith("C++", "Script") == false ``` */ external endsWith: (t, t) => bool = "endsWith" @@ -693,9 +693,9 @@ See [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScrip on MDN. ```res example -Js.String2.startsWith("BuckleScript", "Buckle") == true -Js.String2.startsWith("BuckleScript", "") == true -Js.String2.startsWith("JavaScript", "Buckle") == false +Js.String2.startsWith("ReScript", "Re") == true +Js.String2.startsWith("ReScript", "") == true +Js.String2.startsWith("JavaScript", "Re") == false ``` */ external startsWith: (t, t) => bool = "startsWith" @@ -710,9 +710,9 @@ See [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScrip on MDN. ```res example -Js.String2.startsWithFrom("BuckleScript", "kle", 3) == true -Js.String2.startsWithFrom("BuckleScript", "", 3) == true -Js.String2.startsWithFrom("JavaScript", "Buckle", 2) == false +Js.String2.startsWithFrom("ReScript", "Scri", 2) == true +Js.String2.startsWithFrom("ReScript", "", 2) == true +Js.String2.startsWithFrom("JavaScript", "Scri", 2) == false ``` */ external startsWithFrom: (t, t, int) => bool = "startsWith" diff --git a/jscomp/ounit_tests/ounit_bsb_regex_tests.ml b/jscomp/ounit_tests/ounit_bsb_regex_tests.ml index ffbaeabfa9..076c244a5f 100644 --- a/jscomp/ounit_tests/ounit_bsb_regex_tests.ml +++ b/jscomp/ounit_tests/ounit_bsb_regex_tests.ml @@ -83,7 +83,7 @@ let suites = "watch": "bsb -w", }, "keywords": [ - "Bucklescript" + "ReScript" ], "license": "MIT", "devDependencies": { @@ -102,7 +102,7 @@ let suites = "watch": "bsb -w", }, "keywords": [ - "Bucklescript" + "ReScript" ], "license": "MIT", "devDependencies": { diff --git a/jscomp/syntax/tests/idempotency/genType/src/EmitJs.res b/jscomp/syntax/tests/idempotency/genType/src/EmitJs.res index 7173e2e1f7..95df8ee154 100644 --- a/jscomp/syntax/tests/idempotency/genType/src/EmitJs.res +++ b/jscomp/syntax/tests/idempotency/genType/src/EmitJs.res @@ -1113,7 +1113,7 @@ let emitTranslationAsString = ( : env let finalEnv = config.emitCreateBucklescriptBlock - ? ModuleName.createBucklescriptBlock |> requireModule( + ? ModuleName.createRescriptBlock |> requireModule( ~\"import"=true, ~env, ~importPath=ImportPath.bsBlockPath(~config), diff --git a/jscomp/syntax/tests/idempotency/genType/src/ModuleName.res b/jscomp/syntax/tests/idempotency/genType/src/ModuleName.res index 32d090d0e6..5009724d09 100644 --- a/jscomp/syntax/tests/idempotency/genType/src/ModuleName.res +++ b/jscomp/syntax/tests/idempotency/genType/src/ModuleName.res @@ -1,6 +1,6 @@ type t = string -let createBucklescriptBlock = "CreateBucklescriptBlock" +let createRescriptBlock = "CreateRescriptBlock" let curry = "Curry" diff --git a/jscomp/syntax/tests/idempotency/genType/src/ModuleName.resi b/jscomp/syntax/tests/idempotency/genType/src/ModuleName.resi index 2f8fb8e931..bc77b60ac6 100644 --- a/jscomp/syntax/tests/idempotency/genType/src/ModuleName.resi +++ b/jscomp/syntax/tests/idempotency/genType/src/ModuleName.resi @@ -2,7 +2,7 @@ type t let compare: (t, t) => int -let createBucklescriptBlock: t +let createRescriptBlock: t let curry: t diff --git a/jscomp/syntax/tests/idempotency/genType/src/Runtime.res b/jscomp/syntax/tests/idempotency/genType/src/Runtime.res index 839e3c572c..4fe0a0af44 100644 --- a/jscomp/syntax/tests/idempotency/genType/src/Runtime.res +++ b/jscomp/syntax/tests/idempotency/genType/src/Runtime.res @@ -1,6 +1,6 @@ open GenTypeCommon -let createBucklescriptBlock = "CreateBucklescriptBlock" ++ ".__" +let createRescriptBlock = "CreateRescriptBlock" ++ ".__" type recordGen = { mutable unboxed: int, @@ -89,7 +89,7 @@ let emitVariantWithPayload = (~config, ~label, ~numArgs, ~polymorphic, x) => } else { config.emitCreateBucklescriptBlock = true let args = numArgs == 1 ? list{x} |> EmitText.array : x - createBucklescriptBlock |> EmitText.funCall(~args=list{label, args}) + createRescriptBlock |> EmitText.funCall(~args=list{label, args}) } let jsVariantTag = "tag" diff --git a/jscomp/syntax/tests/idempotency/wildcards-world-ui/LazyThreeBoxUpdate.res b/jscomp/syntax/tests/idempotency/wildcards-world-ui/LazyThreeBoxUpdate.res index 9bd694a59c..937e9731e4 100644 --- a/jscomp/syntax/tests/idempotency/wildcards-world-ui/LazyThreeBoxUpdate.res +++ b/jscomp/syntax/tests/idempotency/wildcards-world-ui/LazyThreeBoxUpdate.res @@ -1,8 +1,8 @@ module type T = module type of ThreeBoxUpdate.Main /* - Needed for BuckleScript to not import the original component : - See https://github.com/BuckleScript/bucklescript/issues/3543 + Needed for ReScript to not import the original component : + See https://github.com/rescript-lang/rescript-compiler/issues/3543 */ let unsafePlaceholder: module(T) = %raw(`{}`) diff --git a/jscomp/syntax/tests/printer/comments/expected/multiline.res.txt b/jscomp/syntax/tests/printer/comments/expected/multiline.res.txt index 34293826fa..b1cd20a7f2 100644 --- a/jscomp/syntax/tests/printer/comments/expected/multiline.res.txt +++ b/jscomp/syntax/tests/printer/comments/expected/multiline.res.txt @@ -21,7 +21,7 @@ let f = () => () * test */ -/* BuckleScript outperforms a classic for-loop: +/* ReScript outperforms a classic for-loop: function equals3(m1, m2) { for (var i = 0; i < 4; i++) { for (var j = 0; j < 4; j++) { diff --git a/jscomp/syntax/tests/printer/comments/multiline.res b/jscomp/syntax/tests/printer/comments/multiline.res index a53a9bbef1..d1c08bc762 100644 --- a/jscomp/syntax/tests/printer/comments/multiline.res +++ b/jscomp/syntax/tests/printer/comments/multiline.res @@ -21,7 +21,7 @@ let f = () => () * test */ -/* BuckleScript outperforms a classic for-loop: +/* ReScript outperforms a classic for-loop: function equals3(m1, m2) { for (var i = 0; i < 4; i++) { for (var j = 0; j < 4; j++) { diff --git a/jscomp/test/reactDOMRe.res b/jscomp/test/reactDOMRe.res index b8d04f3e2c..d5a417fe99 100644 --- a/jscomp/test/reactDOMRe.res +++ b/jscomp/test/reactDOMRe.res @@ -1,5 +1,5 @@ -/* First time reading an OCaml/Reason/BuckleScript file? */ -/* `external` is the foreign function call in OCaml. */ +/* First time reading an ReScript file? */ +/* `external` is the foreign function call. */ /* here we're saying `I guarantee that on the JS side, we have a `render` function in the module "react-dom" that takes in a reactElement, a dom element, and returns unit (nothing) */ /* It's like `let`, except you're pointing the implementation to the JS side. The compiler will inline these From c7237131ff2f776d4fff05454325ca9aeaeebd5a Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sat, 19 Aug 2023 16:50:03 +0200 Subject: [PATCH 2/2] ocamlformat --- jscomp/frontend/ast_external_process.ml | 24 +++++++++++++++++------- jscomp/gentype/GenTypeMain.ml | 3 +-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/jscomp/frontend/ast_external_process.ml b/jscomp/frontend/ast_external_process.ml index 074b7cc6aa..c2137a7502 100644 --- a/jscomp/frontend/ast_external_process.ml +++ b/jscomp/frontend/ast_external_process.ml @@ -406,17 +406,26 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string) param_type :: arg_types, result_types ) | Arg_cst _ -> - ( {obj_arg_label = External_arg_spec.obj_label name; obj_arg_type}, + ( { + obj_arg_label = External_arg_spec.obj_label name; + obj_arg_type; + }, arg_types, (* ignored in [arg_types], reserved in [result_types] *) result_types ) | Nothing -> - ( {obj_arg_label = External_arg_spec.obj_label name; obj_arg_type}, + ( { + obj_arg_label = External_arg_spec.obj_label name; + obj_arg_type; + }, param_type :: arg_types, Parsetree.Otag ({Asttypes.txt = name; loc}, [], ty) :: result_types ) | Int _ -> - ( {obj_arg_label = External_arg_spec.obj_label name; obj_arg_type}, + ( { + obj_arg_label = External_arg_spec.obj_label name; + obj_arg_type; + }, param_type :: arg_types, Otag ( {Asttypes.txt = name; loc}, @@ -424,7 +433,10 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string) Ast_literal.type_int ~loc () ) :: result_types ) | Poly_var_string _ -> - ( {obj_arg_label = External_arg_spec.obj_label name; obj_arg_type}, + ( { + obj_arg_label = External_arg_spec.obj_label name; + obj_arg_type; + }, param_type :: arg_types, Otag ( {Asttypes.txt = name; loc}, @@ -953,9 +965,7 @@ let pval_prim_of_labels (labels : string Asttypes.loc list) = Ext_list.fold_right labels ([] : External_arg_spec.obj_params) (fun p arg_kinds -> - let obj_arg_label = - External_arg_spec.obj_label (p.txt) - in + let obj_arg_label = External_arg_spec.obj_label p.txt in {obj_arg_type = Nothing; obj_arg_label} :: arg_kinds) in External_ffi_types.ffi_obj_as_prims arg_kinds diff --git a/jscomp/gentype/GenTypeMain.ml b/jscomp/gentype/GenTypeMain.ml index ce2f320158..8e90fd1de3 100644 --- a/jscomp/gentype/GenTypeMain.ml +++ b/jscomp/gentype/GenTypeMain.ml @@ -86,8 +86,7 @@ let readCmt cmtFile = try Cmt_format.read_cmt cmtFile with Cmi_format.Error _ -> Log_.item "Error loading %s\n\n" cmtFile; - Log_.item - "It looks like you might have stale compilation artifacts.\n"; + Log_.item "It looks like you might have stale compilation artifacts.\n"; Log_.item "Try to clean and rebuild.\n\n"; assert false