Skip to content

Commit 7974f28

Browse files
Merge pull request #599 from patricoferris/revert-5.3-bump
Revert 5.3 AST Bump
2 parents 3f7ef71 + 82c2100 commit 7974f28

File tree

18 files changed

+272
-509
lines changed

18 files changed

+272
-509
lines changed

CHANGES.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ unreleased
77

88
### Other Changes
99

10-
- Bump ppxlib's AST to 5.3.0 (#558, @patricoferris)
11-
1210
- Fix 5.2 -> 5.3 migration of constants. Those used to always have a `none`
1311
location which can lead to unhelpful error messages.
1412
(#569, @NathanReb)
@@ -29,6 +27,15 @@ unreleased
2927
- Add custom printer support to `pp_ast` functions via the `?printer` config
3028
parameter. (#526, @pedrobslisboa)
3129

30+
0.36.2
31+
------
32+
33+
- Make Ast_builder's default `value_binding` constructor generate the proper
34+
`pvb_constraint` from the pattern and expression arguments.
35+
(#589, @NathanReb)
36+
- Fix pprintast to output correct syntax from `Ppat_constraint (pat, Ptyp_poly ...)`
37+
nodes until they are completely dropped. (#588, @NathanReb)
38+
3239
0.36.1 (2025-07-10)
3340
-------------------
3441

ast/ast.ml

Lines changed: 103 additions & 196 deletions
Large diffs are not rendered by default.

ast/ast_helper_lite.ml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
open Stdlib0
1818
module Location = Astlib.Location
1919
module Longident = Astlib.Longident
20-
open Astlib.Ast_503
20+
open Astlib.Ast_502
2121

2222
[@@@warning "-9"]
2323

@@ -52,20 +52,16 @@ let protect_ref =
5252
let with_default_loc l f = protect_ref (R (default_loc, l)) f
5353

5454
module Const = struct
55-
let mk ?(loc = !default_loc) pconst_desc = { pconst_desc; pconst_loc = loc }
56-
let integer ?loc ?suffix i = mk ?loc (Pconst_integer (i, suffix))
57-
let int ?loc ?suffix i = integer ?loc ?suffix (Int.to_string i)
58-
let int32 ?loc ?(suffix = 'l') i = integer ?loc ~suffix (Int32.to_string i)
59-
let int64 ?loc ?(suffix = 'L') i = integer ?loc ~suffix (Int64.to_string i)
60-
61-
let nativeint ?loc ?(suffix = 'n') i =
62-
integer ?loc ~suffix (Nativeint.to_string i)
63-
64-
let float ?loc ?suffix f = mk ?loc (Pconst_float (f, suffix))
65-
let char ?loc c = mk ?loc (Pconst_char c)
55+
let integer ?suffix i = Pconst_integer (i, suffix)
56+
let int ?suffix i = integer ?suffix (Int.to_string i)
57+
let int32 ?(suffix = 'l') i = integer ~suffix (Int32.to_string i)
58+
let int64 ?(suffix = 'L') i = integer ~suffix (Int64.to_string i)
59+
let nativeint ?(suffix = 'n') i = integer ~suffix (Nativeint.to_string i)
60+
let float ?suffix f = Pconst_float (f, suffix)
61+
let char c = Pconst_char c
6662

6763
let string ?quotation_delimiter ?(loc = !default_loc) s =
68-
mk ~loc (Pconst_string (s, loc, quotation_delimiter))
64+
Pconst_string (s, loc, quotation_delimiter)
6965
end
7066

7167
module Attr = struct

ast/ast_helper_lite.mli

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

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

18-
open Astlib.Ast_503
18+
open Astlib.Ast_502
1919
open Asttypes
2020
open Parsetree
2121

@@ -38,15 +38,14 @@ val with_default_loc : loc -> (unit -> 'a) -> 'a
3838
(** {1 Constants} *)
3939

4040
module Const : sig
41-
val mk : ?loc:loc -> constant_desc -> constant
42-
val char : ?loc:loc -> char -> constant
41+
val char : char -> constant
4342
val string : ?quotation_delimiter:string -> ?loc:loc -> string -> constant
44-
val integer : ?loc:loc -> ?suffix:char -> string -> constant
45-
val int : ?loc:loc -> ?suffix:char -> int -> constant
46-
val int32 : ?loc:loc -> ?suffix:char -> int32 -> constant
47-
val int64 : ?loc:loc -> ?suffix:char -> int64 -> constant
48-
val nativeint : ?loc:loc -> ?suffix:char -> nativeint -> constant
49-
val float : ?loc:loc -> ?suffix:char -> string -> constant
43+
val integer : ?suffix:char -> string -> constant
44+
val int : ?suffix:char -> int -> constant
45+
val int32 : ?suffix:char -> int32 -> constant
46+
val int64 : ?suffix:char -> int64 -> constant
47+
val nativeint : ?suffix:char -> nativeint -> constant
48+
val float : ?suffix:char -> string -> constant
5049
end
5150

5251
(** {1 Attributes} *)

ast/import.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
(*$ open Ast_cinaps_helpers $*)
88

9-
module Js = Versions.OCaml_503
9+
module Js = Versions.OCaml_502
1010
module Ocaml = Versions.OCaml_current
1111

1212
module Select_ast (Ocaml : Versions.OCaml_version) = struct

ast/location_error.ml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ let of_extension (extension : Ast.extension) =
4747
| {
4848
pstr_desc =
4949
Pstr_eval
50-
( {
51-
pexp_desc =
52-
Pexp_constant { pconst_desc = Pconst_string (msg, _, _); _ };
53-
_;
54-
},
55-
[] );
50+
({ pexp_desc = Pexp_constant (Pconst_string (msg, _, _)); _ }, []);
5651
_;
5752
} ->
5853
msg

0 commit comments

Comments
 (0)