123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112(**************************************************************************)(* *)(* OCaml Migrate Parsetree *)(* *)(* Frédéric Bour *)(* Jérémie Dimino, Jane Street Europe *)(* *)(* Copyright 2017 Institut National de Recherche en Informatique et *)(* en Automatique (INRIA). *)(* *)(* All rights reserved. This file is distributed under the terms of *)(* the GNU Lesser General Public License version 2.1, with the *)(* special exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)(*$ #use "src/cinaps_helpers" $*)(* Shared definitions.
Mostly errors about features missing in older versions. *)moduleDef=Migrate_parsetree_def(* Copy of OCaml parsetrees *)(*$foreach_version (fun suffix _ ->
printf "module Ast_%s = Ast_%s\n" suffix suffix
)*)moduleAst_408=Ast_408moduleAst_409=Ast_409moduleAst_410=Ast_410moduleAst_411=Ast_411moduleAst_412=Ast_412moduleAst_413=Ast_413moduleAst_414=Ast_414moduleAst_500=Ast_500moduleAst_51=Ast_51moduleAst_52=Ast_52moduleAst_53=Ast_54moduleAst_54=Ast_54(*$*)(* Manual migration between versions *)(*$foreach_version_pair (fun x y ->
printf "module Migrate_%s_%s = Migrate_parsetree_%s_%s\n" x y x y;
printf "module Migrate_%s_%s = Migrate_parsetree_%s_%s\n" y x y x;
)*)moduleMigrate_408_409=Migrate_parsetree_408_409moduleMigrate_409_408=Migrate_parsetree_409_408moduleMigrate_409_410=Migrate_parsetree_409_410moduleMigrate_410_409=Migrate_parsetree_410_409moduleMigrate_410_411=Migrate_parsetree_410_411moduleMigrate_411_410=Migrate_parsetree_411_410moduleMigrate_411_412=Migrate_parsetree_411_412moduleMigrate_412_411=Migrate_parsetree_412_411moduleMigrate_412_413=Migrate_parsetree_412_413moduleMigrate_413_412=Migrate_parsetree_413_412moduleMigrate_413_414=Migrate_parsetree_413_414moduleMigrate_414_413=Migrate_parsetree_414_413moduleMigrate_414_500=Migrate_parsetree_414_500moduleMigrate_500_414=Migrate_parsetree_500_414moduleMigrate_500_51=Migrate_parsetree_500_51moduleMigrate_51_500=Migrate_parsetree_51_500moduleMigrate_51_52=Migrate_parsetree_51_52moduleMigrate_52_51=Migrate_parsetree_52_51moduleMigrate_52_53=Migrate_parsetree_52_53moduleMigrate_53_52=Migrate_parsetree_53_52moduleMigrate_53_54=Migrate_parsetree_53_54moduleMigrate_54_53=Migrate_parsetree_54_53(*$*)(* An abstraction of OCaml compiler versions *)moduleVersions=Migrate_parsetree_versions(* All versions are compatible with this signature *)moduletypeOCaml_version=Versions.OCaml_version(*$foreach_version (fun suffix _ ->
printf "module OCaml_%s = Versions.OCaml_%s\n" suffix suffix
)*)moduleOCaml_408=Versions.OCaml_408moduleOCaml_409=Versions.OCaml_409moduleOCaml_410=Versions.OCaml_410moduleOCaml_411=Versions.OCaml_411moduleOCaml_412=Versions.OCaml_412moduleOCaml_413=Versions.OCaml_413moduleOCaml_414=Versions.OCaml_414moduleOCaml_500=Versions.OCaml_500moduleOCaml_51=Versions.OCaml_51moduleOCaml_52=Versions.OCaml_52moduleOCaml_53=Versions.OCaml_53moduleOCaml_54=Versions.OCaml_54(*$*)moduleOCaml_current=Versions.OCaml_current(* A Functor taking two OCaml versions and producing a module of functions
migrating from one to the other. *)moduleConvert=Versions.Convert(* Aliases for compiler-libs modules that might be shadowed *)moduleCompiler_libs=structmoduleLocation=LocationmoduleLongident=LongidentmoduletypeAsttypes=moduletypeofstructincludeAsttypesendmodulerecAsttypes:Asttypes=AsttypesmoduletypeParsetree=moduletypeof structincludeParsetreeendmodulerecParsetree:Parsetree=ParsetreemoduleDocstrings=DocstringsmoduleAst_helper=Ast_helpermoduleAst_mapper=Ast_mapperend