Skip to content

Commit

Permalink
Merge pull request #320 from pitag-ha/bump-ast-to-4.14-5.00
Browse files Browse the repository at this point in the history
Bump AST to 4.14/5.00
  • Loading branch information
pitag-ha authored Mar 21, 2022
2 parents 960b0d6 + 9a5a4f3 commit 97722ec
Show file tree
Hide file tree
Showing 9 changed files with 475 additions and 140 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Unreleased
-----------

- Bump ppxlib's AST to 4.14/5.00 (#320, @pitag-ha)

0.25.0 (03/03/2022)
-------------------

Expand Down
240 changes: 186 additions & 54 deletions ast/ast.ml

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions ast/ast_helper_lite.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
open Stdlib0
module Location = Astlib.Location
module Longident = Astlib.Longident
open Astlib.Ast_412
open Astlib.Ast_414

[@@@warning "-9"]

Expand Down Expand Up @@ -171,7 +171,10 @@ module Pat = struct
let constant ?loc ?attrs a = mk ?loc ?attrs (Ppat_constant a)
let interval ?loc ?attrs a b = mk ?loc ?attrs (Ppat_interval (a, b))
let tuple ?loc ?attrs a = mk ?loc ?attrs (Ppat_tuple a)
let construct ?loc ?attrs a b = mk ?loc ?attrs (Ppat_construct (a, b))

let construct ?loc ?attrs a b =
mk ?loc ?attrs (Ppat_construct (a, Option.map (fun b -> ([], b)) b))

let variant ?loc ?attrs a b = mk ?loc ?attrs (Ppat_variant (a, b))
let record ?loc ?attrs a b = mk ?loc ?attrs (Ppat_record (a, b))
let array ?loc ?attrs a = mk ?loc ?attrs (Ppat_array a)
Expand Down Expand Up @@ -451,10 +454,11 @@ module Type = struct
ptype_loc = loc;
}

let constructor ?(loc = !default_loc) ?(attrs = []) ?(args = Pcstr_tuple [])
?res name =
let constructor ?(loc = !default_loc) ?(attrs = []) ?(vars = [])
?(args = Pcstr_tuple []) ?res name =
{
pcd_name = name;
pcd_vars = vars;
pcd_args = args;
pcd_res = res;
pcd_loc = loc;
Expand Down Expand Up @@ -499,11 +503,11 @@ module Te = struct
pext_attributes = attrs;
}

let decl ?(loc = !default_loc) ?(attrs = []) ?(args = Pcstr_tuple []) ?res
name =
let decl ?(loc = !default_loc) ?(attrs = []) ?(vars = [])
?(args = Pcstr_tuple []) ?res name =
{
pext_name = name;
pext_kind = Pext_decl (args, res);
pext_kind = Pext_decl (vars, args, res);
pext_loc = loc;
pext_attributes = attrs;
}
Expand Down
6 changes: 4 additions & 2 deletions ast/ast_helper_lite.mli
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
(* *)
(**************************************************************************)

(** Copy of Ast_helper from OCaml 4.12 with docstring related stuff removed *)
(** Copy of Ast_helper from OCaml 4.14 with docstring related stuff removed *)

open Astlib.Ast_412
open Astlib.Ast_414
open Asttypes
open Parsetree

Expand Down Expand Up @@ -295,6 +295,7 @@ module Type : sig
val constructor :
?loc:loc ->
?attrs:attrs ->
?vars:str list ->
?args:constructor_arguments ->
?res:core_type ->
str ->
Expand Down Expand Up @@ -333,6 +334,7 @@ module Te : sig
val decl :
?loc:loc ->
?attrs:attrs ->
?vars:str list ->
?args:constructor_arguments ->
?res:core_type ->
str ->
Expand Down
2 changes: 1 addition & 1 deletion ast/import.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
It must be opened in all modules, especially the ones coming from the compiler.
*)

module Js = Versions.OCaml_412
module Js = Versions.OCaml_414
module Ocaml = Versions.OCaml_current

module Select_ast (Ocaml : Versions.OCaml_version) = struct
Expand Down
Loading

0 comments on commit 97722ec

Please sign in to comment.