1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253(**************************************************************************)(* *)(* OCaml Migrate Parsetree *)(* *)(* Frédéric Bour *)(* *)(* 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. *)(* *)(**************************************************************************)(* Parser entry points that migrate to a specified version of OCaml.
The parser used is the one from current compiler-libs. The resulting AST is
then converted to the desired version.
These parsing functions can raise Migration_errors.
*)openMigrate_parsetree_versionsletimplementationversion=let{copy_structure;_}=migrateocaml_currentversioninfunlexbuf->copy_structure(Parse.implementationlexbuf)letinterfaceversion=let{copy_signature;_}=migrateocaml_currentversioninfunlexbuf->copy_signature(Parse.interfacelexbuf)lettoplevel_phraseversion=let{copy_toplevel_phrase;_}=migrateocaml_currentversioninfunlexbuf->copy_toplevel_phrase(Parse.toplevel_phraselexbuf)letuse_fileversion=let{copy_toplevel_phrase;_}=migrateocaml_currentversioninfunlexbuf->List.mapcopy_toplevel_phrase(Parse.use_filelexbuf)letcore_typeversion=let{copy_core_type;_}=migrateocaml_currentversioninfunlexbuf->copy_core_type(Parse.core_typelexbuf)letexpressionversion=let{copy_expression;_}=migrateocaml_currentversioninfunlexbuf->copy_expression(Parse.expressionlexbuf)letpatternversion=let{copy_pattern;_}=migrateocaml_currentversioninfunlexbuf->copy_pattern(Parse.patternlexbuf)