unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob b437bfb061575aa349de640ce16dee628354c282 1360 bytes (raw)
name: gnu/packages/patches/ocaml-ppx-variants-ppxlib-api-change.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 
From 6103f6fc56f978c847ba7c1f2d9f38ee93a5e337 Mon Sep 17 00:00:00 2001
From: Sonja Heinze <sonjaleaheinze@gmail.com>
Date: Tue, 9 Mar 2021 12:57:47 +0100
Subject: [PATCH] Adapt to Ppxlib's API change

Ppxlib is removing Lexer.keyword_table from the API in exchange for
the more lightweight Keyword.is_keyword.

Signed-off-by: Sonja Heinze <sonjaleaheinze@gmail.com>
---
Patch from <https://github.com/janestreet/ppx_variants_conv/pull/9>.

 ppx_variants_conv.opam   | 2 +-
 src/ppx_variants_conv.ml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ppx_variants_conv.opam b/ppx_variants_conv.opam
index 7e7148d..b56040f 100644
--- a/ppx_variants_conv.opam
+++ b/ppx_variants_conv.opam
@@ -15,7 +15,7 @@ depends: [
   "base"        {>= "v0.14" & < "v0.15"}
   "variantslib" {>= "v0.14" & < "v0.15"}
   "dune"        {>= "2.0.0"}
-  "ppxlib"      {>= "0.14.0"}
+  "ppxlib"      {>= "0.23.0"}
 ]
 synopsis: "Generation of accessor and iteration functions for ocaml variant types"
 description: "
diff --git a/src/ppx_variants_conv.ml b/src/ppx_variants_conv.ml
index 8d60086..112fc78 100644
--- a/src/ppx_variants_conv.ml
+++ b/src/ppx_variants_conv.ml
@@ -66,7 +66,7 @@ end
 
 let variant_name_to_string v =
   let s = String.lowercase v in
-  if Caml.Hashtbl.mem Lexer.keyword_table s
+  if Keyword.is_keyword s
   then s ^ "_"
   else s
 

debug log:

solving b437bfb061 ...
found b437bfb061 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).