summaryrefslogtreecommitdiff
path: root/libraries/lua-lpeg/README
blob: 2953c759c3ffdc71196af43ad565b69b63742675 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
LPeg is a new pattern-matching library for Lua, based on Parsing
Expression Grammars (PEGs).

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.