           SPELL=ocaml-sedlex
         VERSION=2.2
          SOURCE="sedlex-$VERSION.tar.gz"
        WEB_SITE="https://github.com/ocaml-community/sedlex"
      SOURCE_URL=("$WEB_SITE/archive/v$VERSION.tar.gz")
     SOURCE_HASH=sha512:c38940654d8d2a4b8f627bc9109b0fd983c520d8db05bf4b514ddc05cf50946c086d3558dfced64cc8f2b4eaabc6155426eb44ee6d903e3520ebb65daadf990a
SOURCE_DIRECTORY="$BUILD_DIRECTORY/${SOURCE%.tar.gz}"
      LICENSE[0]="MIT"
         ENTERED=20210106
        KEYWORDS=""
           SHORT="An OCaml lexer generator for Unicode"
cat << EOF
sedlex is a lexer generator for OCaml, similar to ocamllex, but supporting
Unicode. Contrary to ocamllex, lexer specifications for sedlex are embedded
in regular OCaml source files.

The lexers work with a new kind of "lexbuf", similar to ocamllex Lexing
lexbufs, but designed to support Unicode, and abstracting from a specific
encoding. A single lexer can work with arbitrary encodings of the input stream.

sedlex is the successor of the ulex project. Contrary to ulex which was
implemented as a Camlp4 syntax extension, sedlex is based on the new "-ppx"
technology of OCaml, which allow rewriting OCaml parse trees through external
rewriters. (And what a better name than "sed" for a rewriter?)

As any -ppx rewriter, sedlex does not touch the concrete syntax of the
language: lexer specifications are written in source file which comply
with the standard grammar of OCaml programs. sedlex reuse the syntax for
pattern matching in order to describe lexers (regular expressions are encoded
within OCaml patterns). A nice consequence is that your editor (vi, emacs,
...) won't get confused (indentation, coloring) and you don't need to learn
new priority rules. Moreover, sedlex is compatible with any front-end parsing
technology: it works fine even if you use camlp4 or camlp5, with the standard
or revised syntax.
EOF
