Skip to content

Commit

Permalink
Make copy_location the identity function in 5.03 <-> 5.02 migrations
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Rebours <[email protected]>
  • Loading branch information
NathanReb committed Apr 24, 2024
1 parent 862abfe commit f118ab0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 42 deletions.
22 changes: 1 addition & 21 deletions astlib/migrate_502_503.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1277,24 +1277,4 @@ and copy_loc :
fun f0 { Ast_502.Asttypes.txt; Ast_502.Asttypes.loc } ->
{ Ast_503.Asttypes.txt = f0 txt; Ast_503.Asttypes.loc = copy_location loc }

and copy_location : Location.t -> Location.t =
fun { Location.loc_start; Location.loc_end; Location.loc_ghost } ->
{
Location.loc_start = copy_position loc_start;
Location.loc_end = copy_position loc_end;
Location.loc_ghost;
}

and copy_position : Stdlib.Lexing.position -> Stdlib.Lexing.position =
fun {
Stdlib.Lexing.pos_fname;
Stdlib.Lexing.pos_lnum;
Stdlib.Lexing.pos_bol;
Stdlib.Lexing.pos_cnum;
} ->
{
Stdlib.Lexing.pos_fname;
Stdlib.Lexing.pos_lnum;
Stdlib.Lexing.pos_bol;
Stdlib.Lexing.pos_cnum;
}
and copy_location : Location.t -> Location.t = fun x -> x
22 changes: 1 addition & 21 deletions astlib/migrate_503_502.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1274,24 +1274,4 @@ and copy_loc :
fun f0 { Ast_503.Asttypes.txt; Ast_503.Asttypes.loc } ->
{ Ast_502.Asttypes.txt = f0 txt; Ast_502.Asttypes.loc = copy_location loc }

and copy_location : Location.t -> Location.t =
fun { Location.loc_start; Location.loc_end; Location.loc_ghost } ->
{
Location.loc_start = copy_position loc_start;
Location.loc_end = copy_position loc_end;
Location.loc_ghost;
}

and copy_position : Stdlib.Lexing.position -> Stdlib.Lexing.position =
fun {
Stdlib.Lexing.pos_fname;
Stdlib.Lexing.pos_lnum;
Stdlib.Lexing.pos_bol;
Stdlib.Lexing.pos_cnum;
} ->
{
Stdlib.Lexing.pos_fname;
Stdlib.Lexing.pos_lnum;
Stdlib.Lexing.pos_bol;
Stdlib.Lexing.pos_cnum;
}
and copy_location : Location.t -> Location.t = fun x -> x

0 comments on commit f118ab0

Please sign in to comment.