pax_global_header00006660000000000000000000000064134514532720014520gustar00rootroot0000000000000052 comment=d6655353f647d33de12d215aaa477ba936febef3 ppx_derivers-1.2.1/000077500000000000000000000000001345145327200142335ustar00rootroot00000000000000ppx_derivers-1.2.1/.gitignore000066400000000000000000000000401345145327200162150ustar00rootroot00000000000000_build/ .merlin *.install _opam ppx_derivers-1.2.1/CHANGES.md000066400000000000000000000002101345145327200156160ustar00rootroot00000000000000# 1.2.1 - Convert from Jbuilder to Dune (#5). # 1.2 - Fix copyright year # 1.1 - Added a LICENSE.md file # 1.0 - Initial release ppx_derivers-1.2.1/LICENSE.md000066400000000000000000000027561345145327200156510ustar00rootroot00000000000000Copyright (c) 2017, Jeremie Dimino All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Jeremie Dimino nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ppx_derivers-1.2.1/Makefile000066400000000000000000000004541345145327200156760ustar00rootroot00000000000000INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),) .PHONY: all all: dune build .PHONY: install install: dune install $(INSTALL_ARGS) .PHONY: uninstall uninstall: dune uninstall $(INSTALL_ARGS) .PHONY: reinstall reinstall: $(MAKE) uninstall $(MAKE) install .PHONY: clean clean: dune clean ppx_derivers-1.2.1/README.md000066400000000000000000000005501345145327200155120ustar00rootroot00000000000000Ppx_derivers ------------ Ppx_derivers is a tiny package whose sole purpose is to allow [ppx_deriving](https://github.com/whitequark/ppx_deriving) and [ppx_type_conv](https://github.com/janestreet/ppx_type_conv) to inter-operate gracefully when linked as part of the same [ocaml-migrate-parsetree](https://github.com/let-def/ocaml-migrate-parsetree) driver. ppx_derivers-1.2.1/dune-project000066400000000000000000000000441345145327200165530ustar00rootroot00000000000000(lang dune 1.0) (name ppx_derivers) ppx_derivers-1.2.1/pkg/000077500000000000000000000000001345145327200150145ustar00rootroot00000000000000ppx_derivers-1.2.1/pkg/pkg.ml000066400000000000000000000000561345145327200161300ustar00rootroot00000000000000#use "topfind" #require "topkg-jbuilder.auto" ppx_derivers-1.2.1/ppx_derivers.opam000066400000000000000000000011501345145327200176200ustar00rootroot00000000000000opam-version: "2.0" maintainer: "jeremie@dimino.org" authors: ["Jérémie Dimino"] license: "BSD3" homepage: "https://github.com/ocaml-ppx/ppx_derivers" bug-reports: "https://github.com/ocaml-ppx/ppx_derivers/issues" dev-repo: "git://github.com/ocaml-ppx/ppx_derivers.git" build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ "ocaml" "dune" {build} ] synopsis: "Shared [@@deriving] plugin registry" description: """ Ppx_derivers is a tiny package whose sole purpose is to allow ppx_deriving and ppx_type_conv to inter-operate gracefully when linked as part of the same ocaml-migrate-parsetree driver.""" ppx_derivers-1.2.1/src/000077500000000000000000000000001345145327200150225ustar00rootroot00000000000000ppx_derivers-1.2.1/src/dune000066400000000000000000000000731345145327200157000ustar00rootroot00000000000000(library (name ppx_derivers) (public_name ppx_derivers)) ppx_derivers-1.2.1/src/ppx_derivers.ml000066400000000000000000000006421345145327200200700ustar00rootroot00000000000000type deriver = .. let all = Hashtbl.create 42 let register name deriver = if Hashtbl.mem all name then Printf.ksprintf failwith "Ppx_deriviers.register: %S is already registered" name; Hashtbl.add all name deriver let lookup name = match Hashtbl.find all name with | drv -> Some drv | exception Not_found -> None let derivers () = Hashtbl.fold (fun name drv acc -> (name, drv) :: acc) all [] ppx_derivers-1.2.1/src/ppx_derivers.mli000066400000000000000000000010771345145327200202440ustar00rootroot00000000000000(** Ppx derivers This module holds the various derivers registered by either ppx_deriving or ppx_type_conv. *) (** Type of a deriver. The concrete constructors are added by ppx_type_conv/ppx_deriving. *) type deriver = .. (** [register name deriver] registers a new deriver. Raises if [name] is already registered. *) val register : string -> deriver -> unit (** Lookup a previously registered deriver *) val lookup : string -> deriver option (** [derivers ()] returns all currently registered derivers. *) val derivers : unit -> (string * deriver) list