# Watch: http://www.inf.puc-rio.br/~roberto/lpeg/
           SPELL=lpeg
         VERSION=1.1.0
          SOURCE=$SPELL-$VERSION.tar.gz
   SOURCE_URL[0]=http://www.inf.puc-rio.br/~roberto/$SPELL/$SOURCE
     SOURCE_HASH=sha512:01b2a4ceb2d110e143603bc63c84a59736ea735dd0ed9866286ba115d41be48d09c9ff21c8e2327974d2296944f6508d50a5c3a18f26ac1d81b8b2fc41f61222
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
        WEB_SITE=http://www.inf.puc-rio.br/~roberto/lpeg.html
      LICENSE[0]=MIT
         ENTERED=20080823
           SHORT="Parsing Expression Grammars for Lua"
cat << EOF
LPeg is a new pattern-matching library for Lua, based on Parsing Expression
Grammars (PEGs). In this text, I assume you are familiar with PEGs. If you
are not, you can get a quick start reading the Wikipedia Entry for PEGs or
Section 2 of Parsing Expression Grammars: A Recognition-Based Syntactic
Foundation (the section has only one page). The nice thing about PEGs is
that it has a formal basis (instead of being an ad-hoc set of features),
allows an efficient and simple implementation, and does most things we expect
from a pattern-matching library (and more, as we can define entire grammars).

Following the Snobol tradition, LPeg defines patterns as first-class objects.
That is, patterns are regular Lua values (represented by userdata). The
library offers several functions to create and compose patterns. With the use
of metamethods, several of these functions are provided as infix or prefix
operators. On the one hand, the result is usually much more verbose than the
typical encoding of patterns using the so called regular expressions (which
typically are not regular expressions in the formal sense). On the other hand,
first-class patterns allow much better documentation (as it is easy to comment
the code, to use auxiliary variables to break complex definitions, etc.) and
are extensible, as we can define new functions to create and compose patterns.
EOF
