From 9762f043880295ae05449000da13f8ee98def575 Mon Sep 17 00:00:00 2001 From: Kate Date: Sat, 12 Jun 2021 01:24:27 +0100 Subject: [PATCH 1/4] Add support for ppxlib 0.23.0 --- metaquot/metaquot.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/metaquot/metaquot.ml b/metaquot/metaquot.ml index b5db515..d64754b 100644 --- a/metaquot/metaquot.ml +++ b/metaquot/metaquot.ml @@ -93,8 +93,12 @@ let quote_of_path (path : Path.t) : Ppxlib.expression = let name = match Untypeast.lident_of_path path with | Lident name | Ldot (Lident "Asttypes", name) -> name - | Ldot (Lident "Location", "t") -> "location" - | Ldot (Lident "Longident", "t") -> "longident" + | Ldot (Lident "Location", "t") (* ppxlib < 0.23.0 *) + | Ldot (Ldot (Lident "Astlib__", "Location"), "t") -> (* ppxlib >= 0.23.0 *) + "location" + | Ldot (Lident "Longident", "t") (* ppxlib < 0.23.0 *) + | Ldot (Ldot (Lident "Astlib__", "Longident"), "t") -> (* ppxlib >= 0.23.0 *) + "longident" | lident -> failwith (Format.asprintf "quote_of_path: %s" (String.concat "." (Longident.flatten lident))) in From 4a0a48cbc162428e41b9e5dac877729b6b6fe417 Mon Sep 17 00:00:00 2001 From: Kate Date: Sat, 12 Jun 2021 01:24:45 +0100 Subject: [PATCH 2/4] Remove unused dependency --- ppx/dune | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ppx/dune b/ppx/dune index 989a456..06cb86b 100644 --- a/ppx/dune +++ b/ppx/dune @@ -5,5 +5,4 @@ (ppx_runtime_libraries compiler-libs) ; -warning 40: Constructor or label name used out of scope. (OCaml <=4.06.0) (flags -w -40) - (libraries ocaml-migrate-parsetree compiler-libs metapp stdcompat - metaquot)) + (libraries compiler-libs metapp stdcompat metaquot)) From 9658da5d432bdee0864fe24a203a9e0c2b67ff7c Mon Sep 17 00:00:00 2001 From: Kate Date: Sat, 12 Jun 2021 01:13:12 +0100 Subject: [PATCH 3/4] Remove a warning in the tests --- tests/for/for_test.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/for/for_test.ml b/tests/for/for_test.ml index f3a09a0..e00286b 100644 --- a/tests/for/for_test.ml +++ b/tests/for/for_test.ml @@ -6,5 +6,5 @@ let () = | { pstr_desc = Pstr_type (Recursive, [ { ptype_name = { txt = "t1"; _ }; _}; { ptype_name = { txt = "t2"; _ }; _}; - { ptype_name = { txt = "t3"; _ }; _}])} -> () + { ptype_name = { txt = "t3"; _ }; _}]); _} -> () | _ -> assert false From 0dd686ea1b89c940967aa43eaaa1eca7696378cb Mon Sep 17 00:00:00 2001 From: Kate Date: Sat, 12 Jun 2021 01:20:38 +0100 Subject: [PATCH 4/4] Add support for OCaml 4.13 --- metaquot/metaquot.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metaquot/metaquot.ml b/metaquot/metaquot.ml index d64754b..8dae420 100644 --- a/metaquot/metaquot.ml +++ b/metaquot/metaquot.ml @@ -247,7 +247,7 @@ let quote_of_declaration (prefix : Longident.t) (name : string) (Metapp.apply (quote_of_type_expr (Option.get declaration.type_manifest)) [Metapp.Exp.var "x"])] - | Type_variant ctors -> + | Type_variant (ctors, _) -> List.map (case_of_ctor prefix) ctors | Type_record (labels, _) -> [quote_of_record prefix labels]