A pure Lua port of LPeg, a Parsing Expression Grammars library for pattern matching and text processing.
LuLPeg is a pure Lua port of LPeg, Roberto Ierusalimschy's Parsing Expression Grammars library. It provides a powerful pattern-matching and text processing toolkit for Lua developers, enabling grammar construction, parsing, and complex text transformations without external C dependencies.
Lua developers who need advanced text processing, parsing, or grammar implementation capabilities in environments where native extensions (like the original LPeg) aren't available or desirable.
Developers choose LuLPeg when they need LPeg's functionality in pure Lua environments—it's portable, dependency-free, and serves as a drop-in replacement for the original library, though with some performance trade-offs.
A port of LPeg 100% written in Lua.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implemented entirely in Lua with no external dependencies, it runs anywhere Lua runs, making it highly portable for restricted environments.
Emulates LPeg v0.12 and passes most of its test suite, serving as a drop-in replacement for seamless integration in existing projects.
Compatible with Lua 5.1, 5.2, and LuaJIT, ensuring broad applicability across different Lua installations without modification.
Patterns are compiled to Lua functions using a combinators approach, leveraging Lua's strengths for flexible grammar construction.
It is up to 100 times slower than the original C-based LPeg in Lua 5.1/5.2, and with LuaJIT, performance is unpredictable, ranging from 2 to 10 times slower.
The README admits it lacks checks for infinite loops and grammar errors during development, making it unsuitable for debugging new grammars.
No tail call elimination means grammars with long loops can cause stack overflows, as demonstrated in the README with finite automaton examples.
Only supports the basic C locale and has bitrotten UTF-8 support available only on request, limiting internationalization capabilities.