From 49545decbfa01086a31d8342868575d4dc73d556 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 24 Apr 2020 19:03:54 -0400 Subject: [PATCH] update `top` packages --- Makefile | 3 ++- src/data/dune | 2 +- src/data/top/containers_data_top.ml | 27 +++++++++++++++++++++++++++ src/data/top/dune | 7 +++++++ src/top/containers_top.ml | 9 ++------- src/top/dune | 4 +--- 6 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 src/data/top/containers_data_top.ml create mode 100644 src/data/top/dune diff --git a/Makefile b/Makefile index 26d6e441..8e57f6bf 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ PROMOTE=$(if $(shell ocamlc -version |grep '4\.0[012]\.[0-9][0-9]*'), \ --ignore-promoted-rules, ) +PACKAGES=containers,containers-data,containers-thread all: build test build: - dune build $(PROMOTE) @install + dune build $(PROMOTE) @install -p $(PACKAGES) test: build dune runtest --no-buffer --force diff --git a/src/data/dune b/src/data/dune index d260740a..9e9ace90 100644 --- a/src/data/dune +++ b/src/data/dune @@ -1,7 +1,7 @@ (library (name containers_data) - (public_name containers.data) + (public_name containers-data) (wrapped false) (flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -open CCShims_) (ocamlopt_flags :standard (:include ../flambda.flags)) diff --git a/src/data/top/containers_data_top.ml b/src/data/top/containers_data_top.ml new file mode 100644 index 00000000..e11886af --- /dev/null +++ b/src/data/top/containers_data_top.ml @@ -0,0 +1,27 @@ + +(* This file is free software, part of containers. See file "license" for more details. *) + +type 'a printer = Format.formatter -> 'a -> unit + +let eval_exn str = + let lexbuf = Lexing.from_string str in + let phrase = !Toploop.parse_toplevel_phrase lexbuf in + Toploop.execute_phrase false Format.err_formatter phrase + +let install_printer s = + try + ignore (eval_exn ("#install_printer " ^ s ^ " ;; ")) + with _ -> + Printexc.print_backtrace stderr; + () +let install_printers = List.iter install_printer + +let () = + install_printers + [ "CCBV.pp"; + "CCDeque.pp"; + "CCFQueue.pp"; + "CCFun_vec.pp"; + "CCIntMap.pp"; + "CCPersistentArray.pp"; + ] diff --git a/src/data/top/dune b/src/data/top/dune new file mode 100644 index 00000000..28fd3e8e --- /dev/null +++ b/src/data/top/dune @@ -0,0 +1,7 @@ + +(library + (name containers_data_top) + (public_name containers-data.top) + (wrapped false) + (flags :standard -warn-error -a+8 -safe-string) + (libraries compiler-libs.common containers containers-data)) diff --git a/src/top/containers_top.ml b/src/top/containers_top.ml index ba1f8502..cf3e99ae 100644 --- a/src/top/containers_top.ml +++ b/src/top/containers_top.ml @@ -17,11 +17,6 @@ let install_printers = List.iter install_printer let () = install_printers - [ "CCHashtbl.pp" - ; "CCBV.pp" - ; "CCDeque.pp" - ; "CCFQueue.pp" - ; "CCIntMap.pp" - ; "CCPersistentArray.pp" - ; "CCSexp.pp" + [ "CCHashtbl.pp"; + "CCSexp.pp"; ] diff --git a/src/top/dune b/src/top/dune index 226f2347..b4256d71 100644 --- a/src/top/dune +++ b/src/top/dune @@ -6,6 +6,4 @@ (wrapped false) (flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string) (ocamlopt_flags :standard (:include ../flambda.flags)) - (libraries compiler-libs.common containers containers.data - containers.unix containers.sexp containers.iter) - ) + (libraries compiler-libs.common containers containers.unix containers.sexp))