diff options
author | Stephane Glondu <steph@glondu.net> | 2020-01-09 16:07:49 +0100 |
---|---|---|
committer | Stéphane Glondu <steph@glondu.net> | 2020-01-09 16:07:49 +0100 |
commit | 5fb2567f7f19a358bc495d3efc8a231a0beca864 (patch) | |
tree | a6e1d2494c497aaa3a9d657a65bc86ef64edea52 | |
parent | 2a479ef4f28969769afe8ad375c14281e845ac8b (diff) |
New upstream version 0.13.0
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | sexp_conv.ml | 21 | ||||
-rw-r--r-- | sexp_conv.mli | 5 | ||||
-rw-r--r-- | sexplib0.opam | 4 |
4 files changed, 23 insertions, 8 deletions
@@ -1,4 +1,5 @@ _build *.install *.merlin +_opam diff --git a/sexp_conv.ml b/sexp_conv.ml index 5c57c14..c185c02 100644 --- a/sexp_conv.ml +++ b/sexp_conv.ml @@ -98,14 +98,23 @@ module Exn_converter = struct module Exn_ids = Map.Make (Int) + module Obj = struct + module Extension_constructor = struct + [@@@ocaml.warning "-3"] + type t = extension_constructor + let id = Obj.extension_id + let of_val = Obj.extension_constructor + end + end + let exn_id_map - : (extension_constructor, exn -> Sexp.t) Ephemeron.K1.t Exn_ids.t ref = + : (Obj.Extension_constructor.t, exn -> Sexp.t) Ephemeron.K1.t Exn_ids.t ref = ref Exn_ids.empty (* [Obj.extension_id] works on both the exception itself, and the extension slot of the exception. *) - let rec clean_up_handler (slot : extension_constructor) = - let id = Obj.extension_id slot in + let rec clean_up_handler (slot : Obj.Extension_constructor.t) = + let id = Obj.Extension_constructor.id slot in let old_exn_id_map = !exn_id_map in let new_exn_id_map = Exn_ids.remove id old_exn_id_map in (* This trick avoids mutexes and should be fairly efficient *) @@ -117,7 +126,7 @@ module Exn_converter = struct (* Ephemerons are used so that [sexp_of_exn] closure don't keep the extension_constructor live. *) let add ?(finalise = true) extension_constructor sexp_of_exn = - let id = Obj.extension_id extension_constructor in + let id = Obj.Extension_constructor.id extension_constructor in let rec loop () = let old_exn_id_map = !exn_id_map in let ephe = Ephemeron.K1.create () in @@ -140,10 +149,10 @@ module Exn_converter = struct loop () let add_auto ?finalise exn sexp_of_exn = - add ?finalise (Obj.extension_constructor exn) sexp_of_exn + add ?finalise (Obj.Extension_constructor.of_val exn) sexp_of_exn let find_auto exn = - let id = Obj.extension_id (Obj.extension_constructor exn) in + let id = Obj.Extension_constructor.id (Obj.Extension_constructor.of_val exn) in match Exn_ids.find id !exn_id_map with | exception Not_found -> None | ephe -> diff --git a/sexp_conv.mli b/sexp_conv.mli index 6e192b0..90c2625 100644 --- a/sexp_conv.mli +++ b/sexp_conv.mli @@ -2,10 +2,15 @@ (** Dummy definitions for "optional" options, lists, and for opaque types *) type sexp_bool = bool +[@@deprecated "[since 2019-03] use [@sexp.bool] instead"] type 'a sexp_option = 'a option +[@@deprecated "[since 2019-03] use [@sexp.option] instead"] type 'a sexp_list = 'a list +[@@deprecated "[since 2019-03] use [@sexp.list] instead"] type 'a sexp_array = 'a array +[@@deprecated "[since 2019-03] use [@sexp.array] instead"] type 'a sexp_opaque = 'a +[@@deprecated "[since 2019-03] use [@sexp.opaque] instead"] (** {6 Conversion of OCaml-values to S-expressions} *) diff --git a/sexplib0.opam b/sexplib0.opam index 26bc40a..ac23449 100644 --- a/sexplib0.opam +++ b/sexplib0.opam @@ -1,5 +1,5 @@ opam-version: "2.0" -version: "v0.12.0" +version: "v0.13.0" maintainer: "opensource@janestreet.com" authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] homepage: "https://github.com/janestreet/sexplib0" @@ -12,7 +12,7 @@ build: [ ] depends: [ "ocaml" {>= "4.04.2"} - "dune" {build & >= "1.5.1"} + "dune" {>= "1.5.1"} ] synopsis: "Library containing the definition of S-expressions and some base converters" description: " |