ocaml-mlx / mlx

OCaml syntax dialect which adds JSX syntax expressions
Other
76 stars 1 forks source link

Support other OCaml versions through 5.1 AST #6

Closed andreypopp closed 2 months ago

andreypopp commented 2 months ago

Currently mlx copies parser/AST from OCaml 5.1 and ocamlmerlin-mlx copies parser/AST (and everything else needed) from merlin's 510 branch (corresponds to 5.1 OCaml version).

So we say that mlx toolchain is based on OCaml 5.1.

Now to support other OCaml versions we need:

  1. to compiler 5.1 AST/parser with the current OCaml version
  2. convert AST to the current OCaml version's AST

This PR implements this with the help of ppxlib. Unfortunately 1. point above requires venturing more Merlin code and some Obj.magic (but hopefully we can get rid of it soon).