aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/ocaml.scm
diff options
context:
space:
mode:
authorGabriel Hondet <gabrielhondet@gmail.com>2019-01-03 08:26:51 +0100
committerJulien Lepiller <julien@lepiller.eu>2019-01-16 20:08:26 +0100
commit7726124ae20e371fd95917cf4a7b4f621b0f5220 (patch)
tree81333c5699ac47cdae15ed779bbf683949603539 /gnu/packages/ocaml.scm
parent5fa01e8aaad503939036a34e0ee79d5781f5c4f1 (diff)
downloadpatches-7726124ae20e371fd95917cf4a7b4f621b0f5220.tar
patches-7726124ae20e371fd95917cf4a7b4f621b0f5220.tar.gz
gnu: Add ocaml-parsexp.
* gnu/packages/ocaml.scm (ocaml-parsexp): New variable. Signed-off-by: Julien Lepiller <julien@lepiller.eu>
Diffstat (limited to 'gnu/packages/ocaml.scm')
-rw-r--r--gnu/packages/ocaml.scm46
1 files changed, 46 insertions, 0 deletions
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 65df9d4ed2..9103dd94a8 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -4890,3 +4890,49 @@ base converters")
libraries is an industrial strength alternative to OCaml's standard library
that was developed by Jane Street, the largest industrial user of OCaml.")
(license license:expat)))
+
+(define-public ocaml-parsexp
+ (package
+ (name "ocaml-parsexp")
+ (version "0.11.0")
+ (home-page "https://github.com/janestreet/parsexp")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url (string-append home-page ".git"))
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1nyq23s5igd8cf3n4qxprjvhbmb6ighb3fy5mw7hxl0mdgsw5fvz"))))
+ (build-system dune-build-system)
+ (inputs
+ `(("ocaml-sexplib0" ,ocaml-sexplib0)))
+ (synopsis "S-expression parsing library")
+ (description
+ "This library provides generic parsers for parsing S-expressions from
+strings or other medium.
+
+The library is focused on performances but still provide full generic
+parsers that can be used with strings, bigstrings, lexing buffers,
+character streams or any other sources effortlessly.
+
+It provides three different class of parsers:
+@itemize
+@item
+the normal parsers, producing [Sexp.t] or [Sexp.t list] values
+@item
+the parsers with positions, building compact position sequences so
+that one can recover original positions in order to report properly
+located errors at little cost
+@item
+the Concrete Syntax Tree parsers, produce values of type
+@code{Parsexp.Cst.t} which record the concrete layout of the s-expression
+syntax, including comments
+@end itemize
+
+This library is portable and doesn't provide IO functions. To read
+s-expressions from files or other external sources, you should use
+parsexp_io.")
+ (license license:expat)))