summaryrefslogtreecommitdiff
path: root/src_plugins
diff options
context:
space:
mode:
authorStephane Glondu <steph@glondu.net>2021-12-26 20:36:26 +0100
committerStephane Glondu <steph@glondu.net>2021-12-26 20:36:26 +0100
commit10b7fe437a3169ae081b5c2a7b3e14f823dc39fd (patch)
tree114d62844f0ed9fa9fd992744e1722e79e0f5037 /src_plugins
parente69dc2d213e860552991d4026def37b03d6df943 (diff)
New upstream version 5.2
Diffstat (limited to 'src_plugins')
-rw-r--r--src_plugins/create/ppx_deriving_create.cppo.ml1
-rw-r--r--src_plugins/enum/ppx_deriving_enum.cppo.ml1
-rw-r--r--src_plugins/eq/ppx_deriving_eq.cppo.ml5
-rw-r--r--src_plugins/fold/ppx_deriving_fold.cppo.ml1
-rw-r--r--src_plugins/iter/ppx_deriving_iter.cppo.ml1
-rw-r--r--src_plugins/make/ppx_deriving_make.cppo.ml1
-rw-r--r--src_plugins/map/ppx_deriving_map.cppo.ml3
-rw-r--r--src_plugins/ord/ppx_deriving_ord.cppo.ml7
-rw-r--r--src_plugins/show/ppx_deriving_show.cppo.ml5
9 files changed, 8 insertions, 17 deletions
diff --git a/src_plugins/create/ppx_deriving_create.cppo.ml b/src_plugins/create/ppx_deriving_create.cppo.ml
index 8d060d7..a62ee9d 100644
--- a/src_plugins/create/ppx_deriving_create.cppo.ml
+++ b/src_plugins/create/ppx_deriving_create.cppo.ml
@@ -1,5 +1,4 @@
open Ppxlib
-open Location
open Asttypes
open Parsetree
open Ast_helper
diff --git a/src_plugins/enum/ppx_deriving_enum.cppo.ml b/src_plugins/enum/ppx_deriving_enum.cppo.ml
index 84aacdf..40d847e 100644
--- a/src_plugins/enum/ppx_deriving_enum.cppo.ml
+++ b/src_plugins/enum/ppx_deriving_enum.cppo.ml
@@ -1,5 +1,4 @@
open Ppxlib
-open Location
open Asttypes
open Parsetree
open Ast_helper
diff --git a/src_plugins/eq/ppx_deriving_eq.cppo.ml b/src_plugins/eq/ppx_deriving_eq.cppo.ml
index c2b5cec..e293121 100644
--- a/src_plugins/eq/ppx_deriving_eq.cppo.ml
+++ b/src_plugins/eq/ppx_deriving_eq.cppo.ml
@@ -1,5 +1,4 @@
open Ppxlib
-open Location
open Asttypes
open Parsetree
open Ast_helper
@@ -67,7 +66,7 @@ and expr_of_typ quoter typ =
let typ = Ppx_deriving.remove_pervasives ~deriver typ in
let expr_of_typ = expr_of_typ quoter in
match attr_equal typ.ptyp_attributes with
- | Some fn -> Ppx_deriving.quote quoter fn
+ | Some fn -> Ppx_deriving.quote ~quoter fn
| None ->
match typ with
| [%type: _] -> [%expr fun _ _ -> true]
@@ -113,7 +112,7 @@ and expr_of_typ quoter typ =
[%expr fun (lazy x) (lazy y) -> [%e expr_of_typ typ] x y]
| _, { ptyp_desc = Ptyp_constr ({ txt = lid }, args) } ->
let equal_fn = Exp.ident (mknoloc (Ppx_deriving.mangle_lid (`Prefix "equal") lid)) in
- let fwd = app (Ppx_deriving.quote quoter equal_fn) (List.map expr_of_typ args) in
+ let fwd = app (Ppx_deriving.quote ~quoter equal_fn) (List.map expr_of_typ args) in
(* eta-expansion is necessary for recursive groups *)
[%expr fun x -> [%e fwd] x]
| _ -> assert false
diff --git a/src_plugins/fold/ppx_deriving_fold.cppo.ml b/src_plugins/fold/ppx_deriving_fold.cppo.ml
index c6345cc..65be694 100644
--- a/src_plugins/fold/ppx_deriving_fold.cppo.ml
+++ b/src_plugins/fold/ppx_deriving_fold.cppo.ml
@@ -1,5 +1,4 @@
open Ppxlib
-open Location
open Asttypes
open Parsetree
open Ast_helper
diff --git a/src_plugins/iter/ppx_deriving_iter.cppo.ml b/src_plugins/iter/ppx_deriving_iter.cppo.ml
index a950323..340db0a 100644
--- a/src_plugins/iter/ppx_deriving_iter.cppo.ml
+++ b/src_plugins/iter/ppx_deriving_iter.cppo.ml
@@ -1,5 +1,4 @@
open Ppxlib
-open Location
open Asttypes
open Parsetree
open Ast_helper
diff --git a/src_plugins/make/ppx_deriving_make.cppo.ml b/src_plugins/make/ppx_deriving_make.cppo.ml
index ada9ce5..907f906 100644
--- a/src_plugins/make/ppx_deriving_make.cppo.ml
+++ b/src_plugins/make/ppx_deriving_make.cppo.ml
@@ -1,5 +1,4 @@
open Ppxlib
-open Location
open Asttypes
open Parsetree
open Ast_helper
diff --git a/src_plugins/map/ppx_deriving_map.cppo.ml b/src_plugins/map/ppx_deriving_map.cppo.ml
index d778c21..41ac1f4 100644
--- a/src_plugins/map/ppx_deriving_map.cppo.ml
+++ b/src_plugins/map/ppx_deriving_map.cppo.ml
@@ -1,5 +1,4 @@
open Ppxlib
-open Location
open Asttypes
open Parsetree
open Ast_helper
@@ -70,7 +69,7 @@ let rec expr_of_typ ?decl typ =
(exp_variant label (Some [%expr [%e expr_of_typ ?decl typ] x]))
| Rinherit({ ptyp_desc = Ptyp_constr (tname, _) } as typ) -> begin
match decl with
- | None ->
+ | None ->
raise_errorf "inheritance of polymorphic variants not supported"
| Some(d) ->
Exp.case [%pat? [%p Pat.type_ tname] as x]
diff --git a/src_plugins/ord/ppx_deriving_ord.cppo.ml b/src_plugins/ord/ppx_deriving_ord.cppo.ml
index 8e1643a..e810287 100644
--- a/src_plugins/ord/ppx_deriving_ord.cppo.ml
+++ b/src_plugins/ord/ppx_deriving_ord.cppo.ml
@@ -1,6 +1,5 @@
open Ppxlib
open Longident
-open Location
open Asttypes
open Parsetree
open Ast_helper
@@ -68,7 +67,7 @@ and expr_of_typ quoter typ =
let loc = typ.ptyp_loc in
let expr_of_typ = expr_of_typ quoter in
match attr_compare typ.ptyp_attributes with
- | Some fn -> Ppx_deriving.quote quoter fn
+ | Some fn -> Ppx_deriving.quote ~quoter fn
| None ->
let typ = Ppx_deriving.remove_pervasives ~deriver typ in
match typ with
@@ -85,7 +84,7 @@ and expr_of_typ quoter typ =
| [%type: Nativeint.t] | [%type: float] | [%type: bool]
| [%type: char] | [%type: string] | [%type: bytes]) ->
let compare_fn = [%expr fun (a:[%t typ]) b -> Ppx_deriving_runtime.compare a b] in
- Ppx_deriving.quote quoter compare_fn
+ Ppx_deriving.quote ~quoter compare_fn
| true, [%type: [%t? typ] ref] ->
[%expr fun a b -> [%e expr_of_typ typ] !a !b]
| true, [%type: [%t? typ] list] ->
@@ -126,7 +125,7 @@ and expr_of_typ quoter typ =
[%expr fun (lazy x) (lazy y) -> [%e expr_of_typ typ] x y]
| _, { ptyp_desc = Ptyp_constr ({ txt = lid }, args) } ->
let compare_fn = Exp.ident (mknoloc (Ppx_deriving.mangle_lid (`Prefix "compare") lid)) in
- let fwd = app (Ppx_deriving.quote quoter compare_fn) (List.map expr_of_typ args) in
+ let fwd = app (Ppx_deriving.quote ~quoter compare_fn) (List.map expr_of_typ args) in
(* eta-expansion is necessary for recursive groups *)
[%expr fun x -> [%e fwd] x]
| _ -> assert false
diff --git a/src_plugins/show/ppx_deriving_show.cppo.ml b/src_plugins/show/ppx_deriving_show.cppo.ml
index e2b95bc..7b0f574 100644
--- a/src_plugins/show/ppx_deriving_show.cppo.ml
+++ b/src_plugins/show/ppx_deriving_show.cppo.ml
@@ -1,5 +1,4 @@
open Ppxlib
-open Location
open Asttypes
open Parsetree
open Ast_helper
@@ -50,7 +49,7 @@ let pconstrrec name fields = pconstr name [precord ~closed:Closed fields]
let wrap_printer quoter printer =
let loc = !Ast_helper.default_loc in
- Ppx_deriving.quote quoter
+ Ppx_deriving.quote ~quoter
[%expr (let fprintf = Ppx_deriving_runtime.Format.fprintf in [%e printer]) [@ocaml.warning "-26"]]
let pp_type_of_decl ~options ~path type_decl =
@@ -158,7 +157,7 @@ let rec expr_of_typ quoter typ =
| Some printer -> wrap_printer quoter printer
| None ->
let printer = Exp.ident (mknoloc (Ppx_deriving.mangle_lid (`Prefix "pp") lid)) in
- Ppx_deriving.quote quoter printer
+ Ppx_deriving.quote ~quoter printer
in
app printer (args_pp @ [[%expr fmt]])
| _ -> assert false