From 968a39b6bc56b14a56ffe3a8f25dbf9c0cc8bfb6 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 13 Nov 2019 15:30:11 -0600 Subject: [PATCH] fix: restore `CCSexp.atom` which was lost in 2.7 --- src/sexp/CCSexp.ml | 3 ++- src/sexp/CCSexp.mli | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sexp/CCSexp.ml b/src/sexp/CCSexp.ml index 65f1ccd0..54345c49 100644 --- a/src/sexp/CCSexp.ml +++ b/src/sexp/CCSexp.ml @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Simple S-expression parsing/printing} *) @@ -365,3 +364,5 @@ include (Make(struct (*$Q & ~count:100 sexp_gen (fun s -> sexp_valid s ==> (to_string s |> parse_string = Result.Ok s)) *) + +let atom s : t = `Atom s diff --git a/src/sexp/CCSexp.mli b/src/sexp/CCSexp.mli index 2a1c27a6..54467f2d 100644 --- a/src/sexp/CCSexp.mli +++ b/src/sexp/CCSexp.mli @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Handling S-expressions} *) @@ -34,3 +33,6 @@ type t = [ ] include S with type t := t + +val atom : string -> t +(** Build an atom directly from a string. *)