Skip to content

Commit

Permalink
Merge pull request #107 from ceastlund/support-4.12
Browse files Browse the repository at this point in the history
Support 4.12
  • Loading branch information
NathanReb authored Oct 21, 2020
2 parents 72d4546 + 0c16173 commit c85866f
Show file tree
Hide file tree
Showing 8 changed files with 3,398 additions and 6 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ over the diff to make sure the difference are relevant. The `ast_...`
files require some adjustments which should pop up when you do this
diff. Port the old adjustments to the new file as required.

Add migration functions:
- Manually compile the asts (`ocamlc -c src/ast_{NEW,OLD}.ml -I +compiler-libs -I _build/default/src/.migrate_parsetree.objs/byte/ -open Migrate_parsetree__`)
Add migration functions. In the commands below, set $OLD and $NEW to the
appropriate version numbers, e.g. 408 and 409:
- Manually compile the asts (`ocamlc -c src/ast_{$NEW,$OLD}.ml -I +compiler-libs -I _build/default/src/.migrate_parsetree.objs/byte/`)
- Using `tools/gencopy.exe` (`dune build tools/gencopy.exe`), generate copy code to and from previous version (assuming it is 408):
```
_build/default/tools/gencopy.exe -I . -I src/ -I +compiler-libs -map Ast_409:Ast_408 Ast_409.Parsetree.{expression,expr,pattern,pat,core_type,typ,toplevel_phrase} Ast_409.Outcometree.{out_phrase,out_type_extension} > src/migrate_parsetree_409_408_migrate.ml
_build/default/tools/gencopy.exe -I . -I src/ -I +compiler-libs -map Ast_408:Ast_409 Ast_408.Parsetree.{expression,expr,pattern,pat,core_type,typ,toplevel_phrase} Ast_408.Outcometree.{out_phrase,out_type_extension} > src/migrate_parsetree_408_409_migrate.ml
_build/default/tools/gencopy.exe -I . -I src/ -I +compiler-libs -map Ast_$NEW:Ast_$OLD Ast_$NEW.Parsetree.{expression,pattern,core_type,toplevel_phrase} > src/migrate_${NEW}_${OLD}.ml
_build/default/tools/gencopy.exe -I . -I src/ -I +compiler-libs -map Ast_$OLD:Ast_$NEW Ast_$OLD.Parsetree.{expression,pattern,core_type,toplevel_phrase} > src/migrate_${OLD}_${NEW}.ml
```
- Fix the generated code by implementing new cases

Expand Down
2 changes: 1 addition & 1 deletion ocaml-migrate-parsetree.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ build: [
]
depends: [
"dune" {>= "1.11"}
"ocaml" {>= "4.02.3" & < "4.12"}
"ocaml" {>= "4.02.3" & < "4.13"}
]
synopsis: "Convert OCaml parsetrees between different versions"
description: """
Expand Down
Loading

0 comments on commit c85866f

Please sign in to comment.