Skip to content

Commit 9dc3c96

Browse files
authored
feat(compiler)!: Re-implement Grain parser (#1033)
1 parent af86344 commit 9dc3c96

File tree

35 files changed

+8946
-1086
lines changed

35 files changed

+8946
-1086
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ jobs:
6464
run: |
6565
yarn compiler test
6666
67+
- name: Check parser error messages exhaustiveness
68+
run: |
69+
yarn compiler parser:check-errors
70+
6771
# Formatting lint last because building is more important
6872
- name: Run formatting lint
6973
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ js-runner/dist
3131
_esy/
3232
pkg/
3333

34+
# Autogenerated .messages file from Menhir
35+
*.messages.generated
36+
3437
# The grainc.exe binary is copied to the CLI directory during build
3538
cli/bin/grainc.exe
3639
cli/bin/grainc_js.bc.js

compiler/dune-project

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(lang dune 2.3)
22
(name grain)
33
(version 0.4.6)
4+
(using menhir 2.0)
45

56
; Flip this to `true` when we want to generate opam files again
67
(generate_opam_files false)
@@ -22,7 +23,6 @@
2223
(dune-build-info (>= 2.0))
2324
(ppx_sexp_conv (>= 0.14.0))
2425
(sexplib (>= 0.14.0))
25-
(grain_dypgen (= 0.1))
2626
(cmdliner (>= 1.0.2))
2727
(grain_utils (>= 0))
2828
(grain_parsing (>= 0))
@@ -40,7 +40,6 @@
4040
(dune-build-info (>= 2.0))
4141
(ppx_sexp_conv (>= 0.14.0))
4242
(sexplib (>= 0.14.0))
43-
(grain_dypgen (= 0.1))
4443
(binaryen (= 0.9.1))
4544
(cmdliner (>= 1.0.2))
4645
(grain (>= 0))))
@@ -84,7 +83,6 @@
8483
(reason (>= 3.6.0))
8584
(ppx_sexp_conv (>= 0.14.0))
8685
(sexplib (>= 0.14.0))
87-
(grain_dypgen (= 0.1))
8886
(cmdliner (>= 1.0.2))
8987
(binaryen (= 0.9.1))
9088
(grain_utils (>= 0))
@@ -97,7 +95,6 @@
9795
(reason (>= 3.6.0))
9896
(ppx_sexp_conv (>= 0.14.0))
9997
(sexplib (>= 0.14.0))
100-
(grain_dypgen (= 0.1))
10198
(cmdliner (>= 1.0.2))
10299
(grain_utils (>= 0))
103100
(grain_parsing (>= 0))
@@ -110,7 +107,7 @@
110107
(reason (>= 3.6.0))
111108
(ppx_sexp_conv (>= 0.14.0))
112109
(sexplib (>= 0.14.0))
113-
(grain_dypgen (= 0.1))
110+
(menhir (= 20211125))
114111
(cmdliner (>= 1.0.2))
115112
(utf8 (>= 0.0.0))
116113
(ppx_deriving_yojson (>= 3.5.2))
@@ -124,7 +121,6 @@
124121
(reason (>= 3.6.0))
125122
(ppx_sexp_conv (>= 0.14.0))
126123
(sexplib (>= 0.14.0))
127-
(grain_dypgen (= 0.1))
128124
(ocamlgraph (>= 2.0.0))
129125
(cmdliner (>= 1.0.2))
130126
(ppx_deriving_yojson (>= 3.5.2))
@@ -139,7 +135,6 @@
139135
(reason (>= 3.6.0))
140136
(ppx_sexp_conv (>= 0.14.0))
141137
(sexplib (>= 0.14.0))
142-
(grain_dypgen (= 0.1))
143138
(fp (>= 0.0.0))
144139
(fs (>= 0.0.0))
145140
(cmdliner (>= 1.0.2))))

compiler/esy.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@opam/dune-configurator": ">= 2.0.0",
3535
"@opam/fp": "0.0.1",
3636
"@opam/fs": "0.0.2",
37-
"@opam/grain_dypgen": "0.2",
37+
"@opam/menhir": "20211125",
3838
"@opam/ocamlgraph": ">= 2.0.0",
3939
"@opam/ppx_deriving_cmdliner": ">= 0.6.0",
4040
"@opam/ppx_deriving_yojson": ">= 3.5.2",

compiler/esy.lock/index.json

Lines changed: 46 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/esy.lock/opam/grain_dypgen.0.2/files/dypgen.install

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

0 commit comments

Comments
 (0)