A new pattern-matching library for Lua 5.1, based on PEGs

Edit Package lua51-LPeg

LPeg is a new pattern-matching library for Lua, based on Parsing Expression Grammars (PEGs).

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 break complex definitions in smaller parts, etc.) and are extensible, as we can define new functions to create and compose patterns.

Refresh
Refresh
Source Files
Filename Size Changed
lpeg-1.0.0.tar.gz 0000070267 68.6 KB
lua51-LPeg.changes 0000000175 175 Bytes
lua51-LPeg.spec 0000002786 2.72 KB
Latest Revision
Ludwig Nussel's avatar Ludwig Nussel (lnussel) committed (revision 2)
vrev freeze
Comments 0
openSUSE Build Service is sponsored by