Skip to content

Commit 5e0c09f

Browse files
committed
Adapt to rename
1 parent 51275c5 commit 5e0c09f

File tree

15 files changed

+25
-53
lines changed

15 files changed

+25
-53
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131
- name: Checkout
132132
uses: actions/checkout@v4
133133
with:
134-
fetch-depth: 2 # to be able to check for changes in subfolder jscomp/syntax later
134+
fetch-depth: 2 # to be able to check for changes in subfolder compiler/syntax later
135135

136136
- name: Use Node.js
137137
uses: actions/setup-node@v4
@@ -301,7 +301,7 @@ jobs:
301301
id: syntax-diff
302302
shell: bash
303303
run: |
304-
if git diff --name-only --exit-code HEAD^ HEAD -- jscomp/syntax; then
304+
if git diff --name-only --exit-code HEAD^ HEAD -- compiler/syntax; then
305305
echo "syntax_status=unchanged" >> $GITHUB_ENV
306306
else
307307
echo "syntax_status=changed" >> $GITHUB_ENV
@@ -337,7 +337,7 @@ jobs:
337337
run: |
338338
opam exec -- node packages/playground-bundling/scripts/generate_cmijs.js
339339
opam exec -- dune build --profile browser
340-
cp ./_build/default/jscomp/jsoo/jsoo_playground_main.bc.js playground/compiler.js
340+
cp ./_build/default/compiler/jsoo/jsoo_playground_main.bc.js playground/compiler.js
341341
342342
- name: Test playground compiler
343343
if: matrix.build_playground

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ tests/build_tests/*/lib/
5858
*.jsoo.js
5959
*.so
6060
tmp/
61-
jscomp/.lsp
6261
tracing*.json
6362
.nyc_output
6463
.vscode/launch.json

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,17 @@ node scripts/test.js -bsb
162162

163163
**Run ounit tests:**
164164

165-
This will run unit tests for compiler related modules. The tests can be found in `jscomp/ounit_tests`.
165+
This will run unit tests for compiler related modules. The tests can be found in `compiler/ounit_tests`.
166166

167167
```
168168
node scripts/test.js -ounit
169169
```
170170

171171
## Contributing to the Runtime
172172

173-
The runtime implementation is written in OCaml with some raw JS code embedded (`jscomp/runtime` directory).
173+
The runtime implementation is written in ReScript with some raw JS code embedded (`runtime` directory).
174174

175-
The goal is to implement the runtime **purely in OCaml**. This includes removing all existing occurrences of embedded raw JS code as well whenever possible, and you can help!
175+
The goal is to implement the runtime **purely in ReScript**. This includes removing all existing occurrences of embedded raw JS code as well whenever possible, and you can help!
176176

177177
Each new PR should include appropriate testing.
178178

@@ -226,7 +226,7 @@ opam install js_of_ocaml.4.0.0
226226

227227
### Building the Bundle
228228

229-
The entry point of the JSOO bundle is located in `jscomp/jsoo/jsoo_playground_main.ml`, the compiler and its relevant runtime cmij files can be built via make:
229+
The entry point of the JSOO bundle is located in `compiler/jsoo/jsoo_playground_main.ml`, the compiler and its relevant runtime cmij files can be built via make:
230230

231231
```sh
232232
make playground

CREDITS.md

+6-13
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,28 @@ Thanks to the [OCaml](https://ocaml.org) team, obviously, without such a beautif
2020

2121
ReScript builds on these parts of OCaml:
2222

23-
- [`jscomp/core/lam_pass_exits.ml`](jscomp/core/lam_pass_exits.ml)
24-
- [`jscomp/core/lam_pass_lets_dce.ml`](jscomp/core/lam_pass_lets_dce.ml)
23+
- [`compiler/core/lam_pass_exits.ml`](compiler/core/lam_pass_exits.ml)
24+
- [`compiler/core/lam_pass_lets_dce.ml`](compiler/core/lam_pass_lets_dce.ml)
2525

2626
These modules were adapted from [`ocaml/bytecomp/simplif.ml`](ocaml/bytecomp/simplif.ml) for
2727
JavaScript specific optimization purposes.
2828

29-
- [`jscomp/main/rescript_compiler_main.ml`](jscomp/main/rescript_compiler_main.ml)
29+
- [`compiler/main/rescript_compiler_main.ml`](compiler/main/rescript_compiler_main.ml)
3030

31-
`jscomp/main/rescript_compiler_main.ml` is adapted from [`ocaml/driver/main.ml`](ocaml/driver/main.ml). It is the main entry
31+
`compiler/main/rescript_compiler_main.ml` is adapted from [`ocaml/driver/main.ml`](ocaml/driver/main.ml). It is the main entry
3232
point of the underlying compiler.
3333

34-
- [`jscomp/stdlib-406`](jscomp/stdlib-406)
35-
36-
`jscomp/stdlib-*` is copied from [`ocaml/stdlib`](ocaml/stdlib). It is compiled to JavaScript and included with ReScript.
37-
3834
ReScript imported one file from [jsoo](https://github.com/ocsigen/js_of_ocaml)
3935

40-
- [`jscomp/core/js_dump.ml`](jscomp/core/js_dump.ml) (pretty printer)
36+
- [`compiler/core/js_dump.ml`](compiler/core/js_dump.ml) (pretty printer)
4137

4238
This file was imported but changed significantly in iterations later.
4339

4440
- [`tests/tests`](tests/tests)
4541

4642
`tests/tests` is based on [`ocaml/testsuite`](ocaml/testsuite).
4743

48-
ReScript unit test builds on parts of [OUnit](http://ounit.forge.ocamlcore.org/)
49-
50-
- [`jscomp/ounit`](jscomp/ounit) is adapted from ounit, the unit test
51-
utilities are only used for dev purpose, they are not required for distribution
44+
ReScript compiler unit test builds on [OUnit](http://ounit.forge.ocamlcore.org/)
5245

5346
## Ninja
5447

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bench:
1313
$(DUNE_BIN_DIR)/syntax_benchmarks
1414

1515
dce:
16-
reanalyze.exe -dce-cmt _build/default/jscomp
16+
reanalyze.exe -dce-cmt _build/default/compiler
1717

1818
rewatch:
1919
cargo build --manifest-path rewatch/Cargo.toml
@@ -48,7 +48,7 @@ test-gentype:
4848
test-all: test test-gentype
4949

5050
reanalyze:
51-
reanalyze.exe -set-exit-code -all-cmt _build/default/jscomp -suppress jscomp/syntax/testrunner -exclude-paths jscomp/outcome_printer,jscomp/ounit_tests,jscomp/ml,jscomp/js_parser,jscomp/frontend,jscomp/ext,jscomp/depends,jscomp/core,jscomp/common,jscomp/cmij,jscomp/bsb_helper,jscomp/bsb
51+
reanalyze.exe -set-exit-code -all-cmt _build/default/compiler -suppress compiler/syntax/testrunner -exclude-paths compiler/outcome_printer,compiler/ounit_tests,compiler/ml,compiler/js_parser,compiler/frontend,compiler/ext,compiler/depends,compiler/core,compiler/common,compiler/cmij,compiler/bsb_helper,compiler/bsb
5252

5353
lib: build node_modules/.bin/semver
5454
./scripts/buildRuntime.sh
@@ -60,7 +60,7 @@ artifacts: lib
6060
# Builds the core playground bundle (without the relevant cmijs files for the runtime)
6161
playground:
6262
dune build --profile browser
63-
cp ./_build/default/jscomp/jsoo/jsoo_playground_main.bc.js playground/compiler.js
63+
cp ./_build/default/compiler/jsoo/jsoo_playground_main.bc.js playground/compiler.js
6464

6565
# Creates all the relevant core and third party cmij files to side-load together with the playground bundle
6666
playground-cmijs: artifacts

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ For discussions on ongoing development, see the [Development](https://forum.resc
101101

102102
ReScript is licensed under LGPL version 3, with relaxed rules about creating and distributing combined work. See the [LICENSE](LICENSE) file for details.
103103

104-
The ReScript parser (subdirectory `jscomp/syntax`) is licensed under the [MIT License](jscomp/syntax/LICENSE).
104+
The ReScript parser (subdirectory `compiler/syntax`) is licensed under the [MIT License](compiler/syntax/LICENSE).
105105

106106
The `ninja` subdirectory contains the vendored [ninja](https://github.com/ninja-build/ninja) build system.
107107
Refer to its copyright and license notices for information about its licensing.

compiler/bsb/bsb_build_util.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ val include_dirs_by : 'a list -> ('a -> string) -> string
5656

5757
val mkp : string -> unit
5858

59-
(* The path of [bsc] and [bsdep] is normalized so that the invokation of [./jscomp/bin/bsb.exe]
59+
(* The path of [bsc] and [bsdep] is normalized so that the invokation of [./compiler/bin/bsb.exe]
6060
and [bsb.exe] (combined with a dirty bsconfig.json) will not trigger unnecessary rebuild.
6161
6262
The location of [bsc] and [bsdep] is configured by the combination of [Sys.executable_name]

compiler/bsb_helper/bsb_helper_depfile_gen.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ let oc_cmi buf namespace source =
107107
it can be errored out earlier
108108
109109
#5368: It turns out there are many false positives on detecting self-cycles (see: `tests/build_tests/zerocycle`)
110-
To properly solve this, we would need to `jscomp/ml/depend.ml` because
110+
To properly solve this, we would need to `compiler/ml/depend.ml` because
111111
cmi and cmj is broken in the first place (same problem as in ocaml/ocaml#4618).
112112
So we will just ignore the self-cycles. Even if there is indeed a self-cycle, it should fail to compile anyway.
113113
*)

compiler/ext/ext_path.ml

-20
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,6 @@ let split_by_sep_per_os : string -> string list =
4141
x
4242
else fun x -> Ext_string.split x '/'
4343

44-
(** example
45-
{[
46-
"/bb/mbigc/mbig2899/bgit/rescript/jscomp/stdlib/external/pervasives.cmj"
47-
"/bb/mbigc/mbig2899/bgit/rescript/jscomp/stdlib/ocaml_array.ml"
48-
]}
49-
50-
The other way
51-
{[
52-
53-
"/bb/mbigc/mbig2899/bgit/rescript/jscomp/stdlib/ocaml_array.ml"
54-
"/bb/mbigc/mbig2899/bgit/rescript/jscomp/stdlib/external/pervasives.cmj"
55-
]}
56-
{[
57-
"/bb/mbigc/mbig2899/bgit/rescript/jscomp/stdlib//ocaml_array.ml"
58-
]}
59-
{[
60-
/a/b
61-
/c/d
62-
]}
63-
*)
6444
let node_relative_path ~from:(file_or_dir_2 : t) (file_or_dir_1 : t) =
6545
let relevant_dir1 =
6646
match file_or_dir_1 with Dir x -> x

compiler/syntax/benchmarks/Benchmark.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ end = struct
226226
Benchmark.report b
227227

228228
let run () =
229-
let data_dir = "jscomp/syntax/benchmarks/data" in
229+
let data_dir = "compiler/syntax/benchmarks/data" in
230230
benchmark (Filename.concat data_dir "RedBlackTree.res") Rescript Parse;
231231
benchmark (Filename.concat data_dir "RedBlackTree.res") Rescript Print;
232232
benchmark

compiler/syntax/testrunner/res_test.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module IO = Res_io
22

3-
let data_dir = "jscomp/syntax/tests"
3+
let data_dir = "compiler/syntax/tests"
44

55
(* test printing of .res file*)
66
let () =

dune

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(dirs jscomp)
1+
(dirs compiler)

scripts/prebuilt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const assert = require("assert");
77

88
const package_config = require(path.join(__dirname, "..", "package.json"));
99
const bsVersion = fs.readFileSync(
10-
path.join(__dirname, "..", "jscomp", "common", "bs_version.ml"),
10+
path.join(__dirname, "..", "compiler", "common", "bs_version.ml"),
1111
"utf-8",
1212
);
1313

scripts/setVersion.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fs.writeFileSync(
1818
);
1919

2020
fs.writeFileSync(
21-
"./jscomp/common/bs_version.ml",
21+
"./compiler/common/bs_version.ml",
2222
`(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
2323
*
2424
* This program is free software: you can redistribute it and/or modify

scripts/test_syntax.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function maybeWait {
2323
[[ $((taskCount % 20)) = 0 ]] && wait
2424
}
2525

26-
pushd jscomp/syntax
26+
pushd compiler/syntax
2727

2828
rm -rf temp
2929
mkdir temp

0 commit comments

Comments
 (0)