Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/trunk-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install OCaml compiler
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 'ocaml-variants.5.3.1+trunk'
ocaml-compiler: 'ocaml-variants.5.4.0+trunk'
dune-cache: true
cache-prefix: ${{ steps.setup.outputs.cache_prefix }}

Expand Down
2 changes: 2 additions & 0 deletions .ocamlformat-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# and therefore must be excluded from the ocamlformat parsing
astlib/location.ml
astlib/longident.ml
astlib/longident.mli
astlib/astlib.ml
astlib/ast_402.ml
astlib/ast_403.ml
Expand All @@ -19,6 +20,7 @@ astlib/ast_414.ml
astlib/ast_501.ml
astlib/ast_502.ml
astlib/ast_503.ml
astlib/ast_504.ml

# Files that use cinaps to generate code blocks from other code blocks work well,
# but files that inject freely formatted code via cinaps must be excluded
Expand Down
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
unreleased
----------

### 5.4 Support

- Add initial OCaml 5.4 support (#570, @patricoferris, @NathanReb)

### Other Changes

- Bump ppxlib's AST to 5.3.0 (#558, @patricoferris)

- Fix 5.2 -> 5.3 migration of constants. Those used to always have a `none`
Expand Down
43 changes: 24 additions & 19 deletions ast/ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -663,25 +663,30 @@ and type_exception = Parsetree.type_exception = {

and extension_constructor_kind = Parsetree.extension_constructor_kind =
| Pext_decl of string loc list * constructor_arguments * core_type option
(** [Pext_decl(existentials, c_args, t_opt)]
describes a new extension constructor. It can be:
- [C of T1 * ... * Tn] when:
{ul {- [existentials] is [[]],}
{- [c_args] is [[T1; ...; Tn]],}
{- [t_opt] is [None]}.}
- [C: T0] when
{ul {- [existentials] is [[]],}
{- [c_args] is [[]],}
{- [t_opt] is [Some T0].}}
- [C: T1 * ... * Tn -> T0] when
{ul {- [existentials] is [[]],}
{- [c_args] is [[T1; ...; Tn]],}
{- [t_opt] is [Some T0].}}
- [C: 'a... . T1 * ... * Tn -> T0] when
{ul {- [existentials] is [['a;...]],}
{- [c_args] is [[T1; ... ; Tn]],}
{- [t_opt] is [Some T0].}}
*)
(** [Pext_decl(existentials, c_args, t_opt)] describes a new extension
constructor. It can be:
{ul
{- [C of T1 * ... * Tn] when:
- [existentials] is [[]],
- [c_args] is [[T1; ...; Tn]],
- [t_opt] is [None]
}
{- [C: T0] when
- [existentials] is [[]],
- [c_args] is [[]],
- [t_opt] is [Some T0].
}
{- [C: T1 * ... * Tn -> T0] when
- [existentials] is [[]],
- [c_args] is [[T1; ...; Tn]],
- [t_opt] is [Some T0].
}
{- [C: 'a... . T1 * ... * Tn -> T0] when
- [existentials] is [['a;...]],
- [c_args] is [[T1; ... ; Tn]],
- [t_opt] is [Some T0].
}
} *)
| Pext_rebind of longident_loc
(** [Pext_rebind(D)] re-export the constructor [D] with the new name [C]
*)
Expand Down
1 change: 1 addition & 0 deletions ast/supported_version/supported_version.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ let all =
(5, 1);
(5, 2);
(5, 3);
(5, 4);
]

let to_string (a, b) =
Expand Down
10 changes: 10 additions & 0 deletions ast/versions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,13 @@ module OCaml_503 = struct
let string_version = "5.3"
end
let ocaml_503 : OCaml_503.types ocaml_version = (module OCaml_503)
module OCaml_504 = struct
module Ast = Astlib.Ast_504
include Make_witness(Astlib.Ast_504)
let version = 504
let string_version = "5.4"
end
let ocaml_504 : OCaml_504.types ocaml_version = (module OCaml_504)
(*$*)

let all_versions : (module OCaml_version) list = [
Expand All @@ -663,6 +670,7 @@ let all_versions : (module OCaml_version) list = [
(module OCaml_501 : OCaml_version);
(module OCaml_502 : OCaml_version);
(module OCaml_503 : OCaml_version);
(module OCaml_504 : OCaml_version);
(*$*)
]

Expand Down Expand Up @@ -691,6 +699,8 @@ include Register_migration(OCaml_501)(OCaml_502)
(Astlib.Migrate_501_502)(Astlib.Migrate_502_501)
include Register_migration(OCaml_502)(OCaml_503)
(Astlib.Migrate_502_503)(Astlib.Migrate_503_502)
include Register_migration(OCaml_503)(OCaml_504)
(Astlib.Migrate_503_504)(Astlib.Migrate_504_503)
(*$*)

module OCaml_current = OCaml_OCAML_VERSION
Expand Down
1 change: 1 addition & 0 deletions ast/versions.mli
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ module OCaml_500 : OCaml_version with module Ast = Astlib.Ast_500
module OCaml_501 : OCaml_version with module Ast = Astlib.Ast_501
module OCaml_502 : OCaml_version with module Ast = Astlib.Ast_502
module OCaml_503 : OCaml_version with module Ast = Astlib.Ast_503
module OCaml_504 : OCaml_version with module Ast = Astlib.Ast_504
(*$*)

(* An alias to the current compiler version *)
Expand Down
1 change: 0 additions & 1 deletion astlib/ast_408.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

Actually run all lib-unix tests [4.08]
*)

module Asttypes = struct

type constant (*IF_CURRENT = Asttypes.constant *) =
Expand Down
1 change: 0 additions & 1 deletion astlib/ast_409.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)

module Asttypes = struct

type constant (*IF_CURRENT = Asttypes.constant *) =
Expand Down
1 change: 0 additions & 1 deletion astlib/ast_410.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)

module Asttypes = struct
type constant (*IF_CURRENT = Asttypes.constant *) =
Const_int of int
Expand Down
1 change: 0 additions & 1 deletion astlib/ast_411.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)

module Asttypes = struct
type constant (*IF_CURRENT = Asttypes.constant *) =
Const_int of int
Expand Down
1 change: 0 additions & 1 deletion astlib/ast_412.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)

module Asttypes = struct
type constant (*IF_CURRENT = Asttypes.constant *) =
Const_int of int
Expand Down
1 change: 0 additions & 1 deletion astlib/ast_413.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)

module Asttypes = struct
type constant (*IF_CURRENT = Asttypes.constant *) =
Const_int of int
Expand Down
1 change: 0 additions & 1 deletion astlib/ast_414.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)

module Asttypes = struct
type constant (*IF_CURRENT = Asttypes.constant *) =
Const_int of int
Expand Down
Loading