From b1b5d3166522ae1042489aba55d2a2d748816aab Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 24 Apr 2020 19:13:54 -0400 Subject: [PATCH] breaking: move `CCSexp` into the core library, delete containers.sexp --- src/{sexp => core}/CCSexp.ml | 1 - src/{sexp => core}/CCSexp.mli | 13 +++++++++++-- src/{sexp => core}/CCSexp_intf.ml | 0 src/{sexp => core}/CCSexp_lex.mll | 0 src/core/containers.ml | 3 +++ src/core/dune | 7 ++++--- src/sexp/dune | 10 ---------- src/top/dune | 2 +- 8 files changed, 19 insertions(+), 17 deletions(-) rename src/{sexp => core}/CCSexp.ml (99%) rename src/{sexp => core}/CCSexp.mli (78%) rename src/{sexp => core}/CCSexp_intf.ml (100%) rename src/{sexp => core}/CCSexp_lex.mll (100%) delete mode 100644 src/sexp/dune diff --git a/src/sexp/CCSexp.ml b/src/core/CCSexp.ml similarity index 99% rename from src/sexp/CCSexp.ml rename to src/core/CCSexp.ml index bea6a58c..7c585521 100644 --- a/src/sexp/CCSexp.ml +++ b/src/core/CCSexp.ml @@ -23,7 +23,6 @@ module Make(Sexp : SEXP) = struct let of_int x = Sexp.atom (string_of_int x) let of_float x = Sexp.atom (string_of_float x) let of_bool x = Sexp.atom (string_of_bool x) - let atom x = Sexp.atom x let of_unit = Sexp.list [] let of_list l = Sexp.list l let of_rev_list l = Sexp.list (List.rev l) diff --git a/src/sexp/CCSexp.mli b/src/core/CCSexp.mli similarity index 78% rename from src/sexp/CCSexp.mli rename to src/core/CCSexp.mli index 856b5143..887d7fc9 100644 --- a/src/sexp/CCSexp.mli +++ b/src/core/CCSexp.mli @@ -1,6 +1,9 @@ (* This file is free software, part of containers. See file "license" for more details. *) -(** {1 Handling S-expressions} *) +(** {1 Handling S-expressions} + + @since 3.0 moved into containers-core, previously in [containers.sexp] +*) type 'a or_error = ('a, string) result type 'a sequence = ('a -> unit) -> unit @@ -34,5 +37,11 @@ type t = [ include S with type t := t -val atom : string -> t +val equal : t -> t -> bool +(** @since 3.0 *) + +val compare : t -> t -> int +(** @since 3.0 *) + +val atom : string -> t (** Build an atom directly from a string. *) diff --git a/src/sexp/CCSexp_intf.ml b/src/core/CCSexp_intf.ml similarity index 100% rename from src/sexp/CCSexp_intf.ml rename to src/core/CCSexp_intf.ml diff --git a/src/sexp/CCSexp_lex.mll b/src/core/CCSexp_lex.mll similarity index 100% rename from src/sexp/CCSexp_lex.mll rename to src/core/CCSexp_lex.mll diff --git a/src/core/containers.ml b/src/core/containers.ml index 42e53044..16d94403 100644 --- a/src/core/containers.ml +++ b/src/core/containers.ml @@ -45,6 +45,9 @@ module Vector = CCVector module Monomorphic = CCMonomorphic module Utf8_string = CCUtf8_string +module Sexp = CCSexp +module Sexp_intf = CCSexp_intf + module Stdlib = CCShims_.Stdlib include Monomorphic diff --git a/src/core/dune b/src/core/dune index e4055b68..3d316b80 100644 --- a/src/core/dune +++ b/src/core/dune @@ -16,8 +16,9 @@ (public_name containers) (wrapped false) (modules :standard \ mkshims) - (flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -nolabels -open + (flags :standard :standard -warn-error -a+8 -safe-string -nolabels -open CCMonomorphic) - (ocamlopt_flags - (:include ../flambda.flags)) + (ocamlopt_flags (:include ../flambda.flags)) (libraries seq containers.monomorphic)) + +(ocamllex (modules CCSexp_lex)) diff --git a/src/sexp/dune b/src/sexp/dune deleted file mode 100644 index 7d3320a1..00000000 --- a/src/sexp/dune +++ /dev/null @@ -1,10 +0,0 @@ - -(library - (name containers_sexp) - (public_name containers.sexp) - (wrapped false) - (flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string) - (ocamlopt_flags :standard (:include ../flambda.flags)) - (libraries containers)) - -(ocamllex (modules CCSexp_lex)) diff --git a/src/top/dune b/src/top/dune index b4256d71..a23a99e7 100644 --- a/src/top/dune +++ b/src/top/dune @@ -6,4 +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.unix containers.sexp)) + (libraries compiler-libs.common containers containers.unix))