Skip to content

Commit 6239268

Browse files
committed
Ppx: switch ppx_deriving_json to ast 408 (#849)
1 parent c4a023b commit 6239268

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

js_of_ocaml-ppx_deriving_json.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ depends: [
1818
"dune" {>= "1.11.1"}
1919
"js_of_ocaml"
2020
"ocaml-migrate-parsetree"
21-
"ppxlib" {< "0.9.0"}
21+
"ppxlib" {>= "0.9.0"}
2222
]

ppx/ppx_deriving_json/lib/ppx_deriving_json.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
open StdLabels
2121
open Migrate_parsetree
22-
open OCaml_407.Ast
22+
open OCaml_408.Ast
2323
open Ast_helper
2424
open Asttypes
2525
open Parsetree
@@ -76,7 +76,7 @@ let fresh_var bound =
7676
in
7777
loop 0
7878

79-
module To_current = Migrate_parsetree.Convert (OCaml_407) (OCaml_current)
79+
module To_current = Migrate_parsetree.Convert (OCaml_408) (OCaml_current)
8080

8181
let string_of_core_type typ : string =
8282
let typ = { typ with ptyp_attributes = [] } in
@@ -243,8 +243,8 @@ and write_body_of_tuple_type l ~arg ~poly ~tag =
243243
[%e e]]
244244

245245
and write_poly_case r ~arg ~poly =
246-
match r with
247-
| Parsetree.Rtag ({ txt = label; _ }, _, _, l) ->
246+
match r.prf_desc with
247+
| Parsetree.Rtag ({ txt = label; _ }, _, l) ->
248248
let i = hash_variant label and n = List.length l in
249249
let v = fresh_var [] in
250250
let lhs = (if n = 0 then None else Some (pvar v)) |> Ast_helper.Pat.variant label
@@ -339,8 +339,8 @@ let recognize_case_of_constructor i l =
339339
let recognize_body_of_poly_variant l ~loc =
340340
let l =
341341
let f x =
342-
match x with
343-
| Parsetree.Rtag ({ txt = label; _ }, _, _, l) ->
342+
match x.prf_desc with
343+
| Parsetree.Rtag ({ txt = label; _ }, _, l) ->
344344
let i = hash_variant label in
345345
recognize_case_of_constructor i l
346346
| Rinherit { ptyp_desc = Ptyp_constr (lid, _); _ } ->
@@ -361,8 +361,8 @@ let maybe_tuple_type = function
361361
| l -> Ast_helper.Typ.tuple l
362362

363363
let rec read_poly_case ?decl y x =
364-
match x with
365-
| Parsetree.Rtag ({ txt = label; _ }, _, _, l) -> (
364+
match x.prf_desc with
365+
| Parsetree.Rtag ({ txt = label; _ }, _, l) -> (
366366
let i = hash_variant label |> pint in
367367
match l with
368368
| [] -> Ast_helper.Exp.case [%pat? `Cst [%p i]] (Ast_helper.Exp.variant label None)

0 commit comments

Comments
 (0)