Skip to content

Commit dd2e536

Browse files
committed
Support OCaml 5.4
Adds support for the OCaml 5.4, mainly versioning the Longident module and handling migrations of tuples with and without labels. Signed-off-by: Patrick Ferris <[email protected]>
1 parent 68af533 commit dd2e536

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4117
-35
lines changed

.ocamlformat-ignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# and therefore must be excluded from the ocamlformat parsing
33
astlib/location.ml
44
astlib/longident.ml
5+
astlib/longident.mli
56
astlib/astlib.ml
67
astlib/ast_402.ml
78
astlib/ast_403.ml
@@ -19,6 +20,7 @@ astlib/ast_414.ml
1920
astlib/ast_501.ml
2021
astlib/ast_502.ml
2122
astlib/ast_503.ml
23+
astlib/ast_504.ml
2224

2325
# Files that use cinaps to generate code blocks from other code blocks work well,
2426
# but files that inject freely formatted code via cinaps must be excluded

ast/ast_helper_lite.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
(* TODO: remove this open *)
1717
open Stdlib0
1818
module Location = Astlib.Location
19-
module Longident = Astlib.Longident
19+
module Longident = Astlib.Legacy_longident
2020
open Astlib.Ast_502
2121

2222
[@@@warning "-9"]

ast/ast_helper_lite.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ open Parsetree
2121

2222
type 'a with_loc = 'a Astlib.Location.loc
2323
type loc = Astlib.Location.t
24-
type lid = Astlib.Longident.t with_loc
24+
type lid = Astlib.Legacy_longident.t with_loc
2525
type str = string with_loc
2626
type str_opt = string option with_loc
2727
type attrs = attribute list

ast/import.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ module Asttypes = Selected_ast.Ast.Asttypes
193193

194194
(* Other Astlib modules *)
195195
module Location = Astlib.Location
196-
module Longident = Astlib.Longident
196+
module Longident = Astlib.Legacy_longident
197197

198198
module Parse = struct
199199
include Astlib.Parse

ast/versions.ml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,13 @@ module OCaml_503 = struct
647647
let string_version = "5.3"
648648
end
649649
let ocaml_503 : OCaml_503.types ocaml_version = (module OCaml_503)
650+
module OCaml_504 = struct
651+
module Ast = Astlib.Ast_504
652+
include Make_witness(Astlib.Ast_504)
653+
let version = 504
654+
let string_version = "5.4"
655+
end
656+
let ocaml_504 : OCaml_504.types ocaml_version = (module OCaml_504)
650657
(*$*)
651658

652659
let all_versions : (module OCaml_version) list = [
@@ -663,6 +670,7 @@ let all_versions : (module OCaml_version) list = [
663670
(module OCaml_501 : OCaml_version);
664671
(module OCaml_502 : OCaml_version);
665672
(module OCaml_503 : OCaml_version);
673+
(module OCaml_504 : OCaml_version);
666674
(*$*)
667675
]
668676

@@ -691,6 +699,8 @@ include Register_migration(OCaml_501)(OCaml_502)
691699
(Astlib.Migrate_501_502)(Astlib.Migrate_502_501)
692700
include Register_migration(OCaml_502)(OCaml_503)
693701
(Astlib.Migrate_502_503)(Astlib.Migrate_503_502)
702+
include Register_migration(OCaml_503)(OCaml_504)
703+
(Astlib.Migrate_503_504)(Astlib.Migrate_504_503)
694704
(*$*)
695705

696706
module OCaml_current = OCaml_OCAML_VERSION

ast/versions.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ module OCaml_500 : OCaml_version with module Ast = Astlib.Ast_500
153153
module OCaml_501 : OCaml_version with module Ast = Astlib.Ast_501
154154
module OCaml_502 : OCaml_version with module Ast = Astlib.Ast_502
155155
module OCaml_503 : OCaml_version with module Ast = Astlib.Ast_503
156+
module OCaml_504 : OCaml_version with module Ast = Astlib.Ast_504
156157
(*$*)
157158

158159
(* An alias to the current compiler version *)

astlib/ast_407.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
2626
change VERSION for 4.07.0+beta2
2727
*)
28+
module Longident = Legacy_longident
2829

2930
module Asttypes = struct
3031
(** Auxiliary AST types used by parsetree and typedtree. *)

astlib/ast_408.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
2828
Actually run all lib-unix tests [4.08]
2929
*)
30+
module Longident = Legacy_longident
3031

3132
module Asttypes = struct
3233

astlib/ast_409.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
(* special exception on linking described in the file LICENSE. *)
1717
(* *)
1818
(**************************************************************************)
19+
module Longident = Legacy_longident
1920

2021
module Asttypes = struct
2122

astlib/ast_410.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
(* special exception on linking described in the file LICENSE. *)
1717
(* *)
1818
(**************************************************************************)
19+
module Longident = Legacy_longident
1920

2021
module Asttypes = struct
2122
type constant (*IF_CURRENT = Asttypes.constant *) =

astlib/ast_411.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
(* special exception on linking described in the file LICENSE. *)
1717
(* *)
1818
(**************************************************************************)
19+
module Longident = Legacy_longident
1920

2021
module Asttypes = struct
2122
type constant (*IF_CURRENT = Asttypes.constant *) =

astlib/ast_412.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
(* special exception on linking described in the file LICENSE. *)
1717
(* *)
1818
(**************************************************************************)
19+
module Longident = Legacy_longident
1920

2021
module Asttypes = struct
2122
type constant (*IF_CURRENT = Asttypes.constant *) =

astlib/ast_413.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
(* special exception on linking described in the file LICENSE. *)
1717
(* *)
1818
(**************************************************************************)
19+
module Longident = Legacy_longident
1920

2021
module Asttypes = struct
2122
type constant (*IF_CURRENT = Asttypes.constant *) =

astlib/ast_414.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
(* special exception on linking described in the file LICENSE. *)
1717
(* *)
1818
(**************************************************************************)
19+
module Longident = Legacy_longident
1920

2021
module Asttypes = struct
2122
type constant (*IF_CURRENT = Asttypes.constant *) =

astlib/ast_501.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
module Longident = Legacy_longident
2+
13
module Asttypes = struct
24
type constant (*IF_CURRENT = Asttypes.constant *) =
35
Const_int of int

astlib/ast_502.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
module Longident = Legacy_longident
12
module Asttypes = struct
23
type constant (*IF_CURRENT = Asttypes.constant *) =
34
Const_int of int

astlib/ast_503.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
module Longident = Legacy_longident
12
module Asttypes = struct
23
type constant (*IF_CURRENT = Asttypes.constant *) =
34
Const_int of int

0 commit comments

Comments
 (0)