Skip to content

Commit eb76a88

Browse files
committed
Vendor compiler libs and build with ocaml 4.12.
1 parent ec25534 commit eb76a88

Some content is hidden

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

99 files changed

+43525
-64
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ jobs:
4343
key: ${{matrix.os}}-rescript-vscode-v1
4444

4545
- name: Use OCaml
46-
uses: ocaml/setup-ocaml@v1.1.11
46+
uses: ocaml/setup-ocaml@v2
4747
with:
48-
ocaml-version: 4.06.1
48+
ocaml-compiler: 4.12.x
4949

5050
- name: Use Node.js
5151
uses: actions/[email protected]

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Thanks for your interest. Below is an informal spec of how the plugin's server c
2525
## Install Dependencies
2626

2727
- Run `npm install` at the root. This will also install the npm modules for both the `client` and `server` folders.
28-
- `opam switch 4.06.1`. OPAM [here](https://opam.ocaml.org). This is needed for the `analysis` folder, which is native code.
28+
- `opam switch 4.12.0`. OPAM [here](https://opam.ocaml.org). This is needed for the `analysis` folder, which is native code.
2929
- Optionally, you can `opam install ocamlformat` and format the `.ml` files in `analysis`.
3030

3131
## Build & Run

analysis/.depend

Lines changed: 540 additions & 34 deletions
Large diffs are not rendered by default.

analysis/.merlin

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ B src/vendor
33
B src/vendor/odoc_parser
44
B src/vendor/omd
55
B src/vendor/res_outcome_printer
6+
B src/vendor/compiler-libs-406
67
B ../../../.opam/4.06.1/lib/ocaml/compiler-libs/
78

89
S src
910
S src/vendor
1011
S src/vendor/odoc_parser
1112
S src/vendor/omd
1213
S src/vendor/res_outcome_printer
14+
S src/vendor/compiler-libs-406
1315
S ../../../.opam/4.06.1/lib/ocaml/compiler-libs/
1416

1517
FLG -w +26+27+32+33+39

analysis/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
SHELL = /bin/bash
22
MAKEFLAGS += --jobs 4
3-
INCLUDES = -I src -I src/vendor/res_outcome_printer -I src/vendor
3+
INCLUDES = -I src -I src/vendor/res_outcome_printer -I src/vendor -I src/vendor/compiler-libs-406
44

55
OCAMLOPT = ocamlopt.opt
6-
OCAMLFLAGS = -g -w +26+27+32+33+39 -bin-annot -I +compiler-libs $(INCLUDES)
6+
OCAMLFLAGS = -g -w +26+27+32+33+39 -bin-annot $(INCLUDES)
77
OCAMLDEP = ocamldep.opt
88

99
OUTPUT = rescript-editor-analysis.exe
@@ -24,18 +24,18 @@ SOURCE_FILES = $(shell $(OCAMLDEP) -sort `find src -name "*.ml"` | sed -E "s/\.m
2424
$(OUTPUT): $(SOURCE_FILES)
2525
@echo Linking...
2626
@$(OCAMLOPT) $(OCAMLFLAGS) -O2 -o $(OUTPUT) \
27-
unix.cmxa str.cmxa ocamlcommon.cmxa $(INCLUDES) $(SOURCE_FILES)
27+
unix.cmxa str.cmxa $(INCLUDES) $(SOURCE_FILES)
2828
@echo Done!
2929

3030
build-native: $(OUTPUT) depend
3131

3232
dce: build-native
33-
../node_modules/.bin/reanalyze -dce-cmt src -suppress src/vendor
33+
../../reanalyze/_build/install/default/bin/reanalyze.exe -dce-cmt src -suppress src/vendor
3434

3535
tests/node_modules/.bin/rescript:
3636
@cd tests && npm install
3737

38-
test: dce tests/node_modules/.bin/rescript
38+
test: tests/node_modules/.bin/rescript
3939
@cd tests && node_modules/.bin/rescript
4040
./test.sh
4141

analysis/src/ProcessCmt.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ let extraForStructureItems ~(file : File.t)
11461146
| Partial_signature_item str -> Iter.iter_signature_item str
11471147
| Partial_expression expression -> Iter.iter_expression expression
11481148
| Partial_pattern pattern -> Iter.iter_pattern pattern
1149-
| Partial_class_expr class_expr -> Iter.iter_class_expr class_expr
1149+
| Partial_class_expr () -> ()
11501150
| Partial_module_type module_type -> Iter.iter_module_type module_type
11511151
| Partial_structure _ | Partial_structure_item _ -> ());
11521152
extra
@@ -1183,7 +1183,7 @@ let extraForSignatureItems ~(file : File.t)
11831183
| Partial_signature_item str -> Iter.iter_signature_item str
11841184
| Partial_expression expression -> Iter.iter_expression expression
11851185
| Partial_pattern pattern -> Iter.iter_pattern pattern
1186-
| Partial_class_expr class_expr -> Iter.iter_class_expr class_expr
1186+
| Partial_class_expr () -> ()
11871187
| Partial_module_type module_type -> Iter.iter_module_type module_type
11881188
| Partial_structure _ | Partial_structure_item _ -> ());
11891189
extra
@@ -1278,7 +1278,9 @@ let rec resolvePath ~env ~path ~package =
12781278
match result with
12791279
| `Local (env, name) -> Some (env, name)
12801280
| `Global (moduleName, fullPath) -> (
1281-
Log.log ("resolvePath Global path:" ^ pathToString fullPath ^ " module:" ^ moduleName);
1281+
Log.log
1282+
("resolvePath Global path:" ^ pathToString fullPath ^ " module:"
1283+
^ moduleName);
12821284
match fileForModule ~package moduleName with
12831285
| None -> None
12841286
| Some file ->

0 commit comments

Comments
 (0)