This is an automated email from the git hooks/post-receive script. treinen pushed a commit to branch master in repository ppx-derivers.
commit 7cc61e7888fea19e3c659c6d54d0035671bfbfad Author: Ralf Treinen <trei...@free.fr> Date: Mon Oct 16 21:23:30 2017 +0200 New upstream version 1.0 --- .gitignore | 3 +++ Makefile | 23 +++++++++++++++++++++++ README.md | 10 ++++++++++ ppx_derivers.opam | 14 ++++++++++++++ src/jbuild | 3 +++ src/ppx_derivers.ml | 17 +++++++++++++++++ src/ppx_derivers.mli | 19 +++++++++++++++++++ 7 files changed, 89 insertions(+) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f06221c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +_build/ +.merlin +*.install diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1d69010 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),) + +.PHONY: all +all: + jbuilder build @install + +.PHONY: install +install: + jbuilder install $(INSTALL_ARGS) + +.PHONY: uninstall +uninstall: + jbuilder uninstall $(INSTALL_ARGS) + +.PHONY: reinstall +reinstall: + $(MAKE) uninstall + $(MAKE) install + +.PHONY: clean +clean: + rm -rf _build *.install + find . -name .merlin -delete diff --git a/README.md b/README.md new file mode 100644 index 0000000..87aa580 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +Ppx_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. + diff --git a/ppx_derivers.opam b/ppx_derivers.opam new file mode 100644 index 0000000..f2a1596 --- /dev/null +++ b/ppx_derivers.opam @@ -0,0 +1,14 @@ +opam-version: "1.2" +version: "1.0" +maintainer: "jere...@dimino.org" +authors: ["Jérémie Dimino"] +license: "BSD3" +homepage: "https://github.com/diml/ppx_derivers" +bug-reports: "https://github.com/diml/ppx_derivers/issues" +dev-repo: "git://github.com/diml/ppx_derivers.git" +build: [ + ["jbuilder" "build" "-p" name "-j" jobs] +] +depends: [ + "jbuilder" {>= "1.0+beta7"} +] diff --git a/src/jbuild b/src/jbuild new file mode 100644 index 0000000..e1dac1d --- /dev/null +++ b/src/jbuild @@ -0,0 +1,3 @@ +(library + ((name ppx_derivers) + (public_name ppx_derivers))) diff --git a/src/ppx_derivers.ml b/src/ppx_derivers.ml new file mode 100644 index 0000000..9c1fac6 --- /dev/null +++ b/src/ppx_derivers.ml @@ -0,0 +1,17 @@ +type 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 [] diff --git a/src/ppx_derivers.mli b/src/ppx_derivers.mli new file mode 100644 index 0000000..e2765c2 --- /dev/null +++ b/src/ppx_derivers.mli @@ -0,0 +1,19 @@ +(** 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 -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/ppx-derivers.git _______________________________________________ Pkg-ocaml-maint-commits mailing list Pkg-ocaml-maint-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits