Skip to content

Commit

Permalink
simplify some trivial identity transformations
Browse files Browse the repository at this point in the history
Signed-off-by: Carl Eastlund <[email protected]>
  • Loading branch information
ceastlund committed Oct 19, 2020
1 parent 058ff45 commit a238ef2
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions src/migrate_412_411.ml
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ and copy_core_type :
}
and copy_location_stack :
Ast_412.Parsetree.location_stack -> Ast_411.Parsetree.location_stack =
fun x -> List.map copy_location x
fun x -> x
and copy_core_type_desc :
Ast_412.Parsetree.core_type_desc -> Ast_411.Parsetree.core_type_desc =
function
Expand Down Expand Up @@ -1169,11 +1169,7 @@ and copy_constant : Ast_412.Parsetree.constant -> Ast_411.Parsetree.constant
| Ast_412.Parsetree.Pconst_float (x0, x1) ->
Ast_411.Parsetree.Pconst_float (x0, (Option.map (fun x -> x) x1))
and copy_Longident_t : Longident.t -> Longident.t =
function
| Longident.Lident x0 -> Longident.Lident x0
| Longident.Ldot (x0, x1) -> Longident.Ldot ((copy_Longident_t x0), x1)
| Longident.Lapply (x0, x1) ->
Longident.Lapply ((copy_Longident_t x0), (copy_Longident_t x1))
fun x -> x
and copy_loc :
'f0 'g0 .
('f0 -> 'g0) -> 'f0 Ast_412.Asttypes.loc -> 'g0 Ast_411.Asttypes.loc
Expand All @@ -1185,23 +1181,6 @@ and copy_loc :
Ast_411.Asttypes.loc = (copy_location loc)
}
and copy_location : Location.t -> Location.t =
fun
{ Location.loc_start = loc_start; Location.loc_end = loc_end;
Location.loc_ghost = loc_ghost }
->
{
Location.loc_start = (copy_position loc_start);
Location.loc_end = (copy_position loc_end);
Location.loc_ghost = loc_ghost
}
fun x -> x
and copy_position : Stdlib.Lexing.position -> Stdlib.Lexing.position =
fun
{ Stdlib.Lexing.pos_fname = pos_fname; Stdlib.Lexing.pos_lnum = pos_lnum;
Stdlib.Lexing.pos_bol = pos_bol; Stdlib.Lexing.pos_cnum = pos_cnum }
->
{
Stdlib.Lexing.pos_fname = pos_fname;
Stdlib.Lexing.pos_lnum = pos_lnum;
Stdlib.Lexing.pos_bol = pos_bol;
Stdlib.Lexing.pos_cnum = pos_cnum
}
fun x -> x

0 comments on commit a238ef2

Please sign in to comment.