4 ms·
It's a neat trick but as the author says, it's probably too cryptic to use for "real" code. Lua's LPeg lets you create simple recursive grammars to solve probl
by compay 17y ago
It's a neat trick but as the author says, it's probably too cryptic to use for "real" code.
Lua's LPeg lets you create simple recursive grammars to solve problems that are often hard with regular expressions (e.g., matching balanced parentheses). It's the one library from Lua I find myself seriously missing when programming in other languages.
http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html#grammar http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html#grammar