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

Support 4.12 #107

Merged
merged 14 commits into from
Oct 21, 2020
Prev Previous commit
Next Next commit
updated conversion functions
Signed-off-by: Carl Eastlund <[email protected]>
  • Loading branch information
ceastlund committed Oct 19, 2020
commit e17c35f9e98a3570ff1a22fd7f286a7e8ffe4fb4
11 changes: 7 additions & 4 deletions src/migrate_411_412.ml
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,8 @@ and copy_class_infos :
Ast_412.Parsetree.pci_params =
(List.map
(fun x ->
let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
let (x0, x1) = x in
((copy_core_type x0), (copy_variance x1, Ast_412.Asttypes.NoInjectivity)))
pci_params);
Ast_412.Parsetree.pci_name = (copy_loc (fun x -> x) pci_name);
Ast_412.Parsetree.pci_expr = (f0 pci_expr);
Expand Down Expand Up @@ -971,7 +972,8 @@ and copy_type_extension :
Ast_412.Parsetree.ptyext_params =
(List.map
(fun x ->
let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
let (x0, x1) = x in
((copy_core_type x0), (copy_variance x1, Ast_412.Asttypes.NoInjectivity)))
ptyext_params);
Ast_412.Parsetree.ptyext_constructors =
(List.map copy_extension_constructor ptyext_constructors);
Expand Down Expand Up @@ -1024,7 +1026,8 @@ and copy_type_declaration :
Ast_412.Parsetree.ptype_params =
(List.map
(fun x ->
let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
let (x0, x1) = x in
((copy_core_type x0), (copy_variance x1, Ast_412.Asttypes.NoInjectivity)))
ptype_params);
Ast_412.Parsetree.ptype_cstrs =
(List.map
Expand Down Expand Up @@ -1107,7 +1110,7 @@ and copy_variance : Ast_411.Asttypes.variance -> Ast_412.Asttypes.variance =
function
| Ast_411.Asttypes.Covariant -> Ast_412.Asttypes.Covariant
| Ast_411.Asttypes.Contravariant -> Ast_412.Asttypes.Contravariant
| Ast_411.Asttypes.Invariant -> Ast_412.Asttypes.Invariant
| Ast_411.Asttypes.Invariant -> Ast_412.Asttypes.NoVariance
and copy_value_description :
Ast_411.Parsetree.value_description -> Ast_412.Parsetree.value_description
=
Expand Down
19 changes: 7 additions & 12 deletions src/migrate_412_411.ml
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ and copy_class_infos :
(fun x ->
let (x0, x1) = x in
((copy_core_type x0),
(let (x0, x1) = x1 in
((copy_variance x0), (copy_injectivity x1))))) pci_params);
(let (x0, _) = x1 in
(copy_variance x0)))) pci_params);
Ast_411.Parsetree.pci_name = (copy_loc (fun x -> x) pci_name);
Ast_411.Parsetree.pci_expr = (f0 pci_expr);
Ast_411.Parsetree.pci_loc = (copy_location pci_loc);
Expand Down Expand Up @@ -975,8 +975,8 @@ and copy_type_extension :
(fun x ->
let (x0, x1) = x in
((copy_core_type x0),
(let (x0, x1) = x1 in
((copy_variance x0), (copy_injectivity x1))))) ptyext_params);
(let (x0, _) = x1 in
(copy_variance x0)))) ptyext_params);
Ast_411.Parsetree.ptyext_constructors =
(List.map copy_extension_constructor ptyext_constructors);
Ast_411.Parsetree.ptyext_private = (copy_private_flag ptyext_private);
Expand Down Expand Up @@ -1030,8 +1030,8 @@ and copy_type_declaration :
(fun x ->
let (x0, x1) = x in
((copy_core_type x0),
(let (x0, x1) = x1 in
((copy_variance x0), (copy_injectivity x1))))) ptype_params);
(let (x0, _) = x1 in
(copy_variance x0)))) ptype_params);
Ast_411.Parsetree.ptype_cstrs =
(List.map
(fun x ->
Expand Down Expand Up @@ -1109,16 +1109,11 @@ and copy_mutable_flag :
function
| Ast_412.Asttypes.Immutable -> Ast_411.Asttypes.Immutable
| Ast_412.Asttypes.Mutable -> Ast_411.Asttypes.Mutable
and copy_injectivity :
Ast_412.Asttypes.injectivity -> Ast_411.Asttypes.injectivity =
function
| Ast_412.Asttypes.Injective -> Ast_411.Asttypes.Injective
| Ast_412.Asttypes.NoInjectivity -> Ast_411.Asttypes.NoInjectivity
and copy_variance : Ast_412.Asttypes.variance -> Ast_411.Asttypes.variance =
function
| Ast_412.Asttypes.Covariant -> Ast_411.Asttypes.Covariant
| Ast_412.Asttypes.Contravariant -> Ast_411.Asttypes.Contravariant
| Ast_412.Asttypes.NoVariance -> Ast_411.Asttypes.NoVariance
| Ast_412.Asttypes.NoVariance -> Ast_411.Asttypes.Invariant
and copy_value_description :
Ast_412.Parsetree.value_description -> Ast_411.Parsetree.value_description
=
Expand Down