Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for raw identifiers (plus some stuff) #88

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-mingw64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.14.x
ocaml-compiler: 5.2.x
opam-repositories: |
default: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
opam: https://github.com/ocaml/opam-repository.git
Expand Down
41 changes: 28 additions & 13 deletions HACKING.jst.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ time.
Before building
---------------

You will need to install several libraries. This command may work:
You will need a switch that is on OCaml 5. Most jane street devs use different
switches for working on ocamlformat and working on the compiler. You will need
to install several libraries in your switch. This command may work:

```
opam install menhir.20210419 fix ocp-indent bechamel-js alcotest camlp-streams fpath either dune-build-info uuseg ocaml-version stdio
opam install menhir.20231231 fix ocp-indent bechamel-js alcotest camlp-streams fpath either dune-build-info uuseg ocaml-version stdio
```

Building
Expand All @@ -96,17 +98,30 @@ How to update `ocamlformat`

The base branch to work from is called `jane`. Create a branch off of `jane`.

1. Take the patch you wish to support (i.e. some PR in `flambda-backend`).
Apply any changes to the `ocaml/parsing` directory to the files in
`vendor/parser-standard`. Remember: this "standard" parser should be as
close as possible to the compiler's.

Note that some files used by both parsers are stored in
`vendor/ocaml-common` and may need to be updated. Further, when
incorporating new support files from the compiler, consider whether than can
be shared in that directory rather than copied into each of the parser
directories. This is typically the case if the support module doesn't depend
on the parsetree.
1. Apply the parsing changes you need from `flambda-backend` to
`vendor/parser-standard`.

In either case, when incorporating new support files from the compiler,
consider whether than can be shared in `vendor/ocaml-common` rather than
copied into each of the parser directories. This is typically the case if
the support module doesn't depend on the parsetree.

* Option 1 (preferred): Use the `vendor/parser-jane/repatch.sh` script to
import all changes from the latest version of `flambda-backend` (presumably
including the changes you are interested in).

This may pull in additional parser changes, which you can see by looking at
the diff it creates. You aren't obligated to add styling for all new
things, but it might be good to point out to the author of the relevant
features that they have work to do here eventually, or make tickets.

* Option 2: Manually apply the relevant changes to `vendor/parser-standard`.
This option is worse because it means `parser-standard` no longer tracks a
specific revision of the compiler's parser, and is likely to create
conflicts when using Option 1 in the future. Remember: this "standard"
parser should be as close as possible to the compiler's. Note that some
files used by both parsers are stored in `vendor/ocaml-common` and may need
to be updated.

2. Get `ocamlformat` compiled and passing the tests. If the patch to
`flambda-backend` was backward compatible, then this should be
Expand Down
Loading
Loading