2 ms·
PEGs are already so simple and easy to use that as a practical matter you don't gain that much from relying on packrat parsing. LPeg, the standard PEG library i
by wahern 7y ago
PEGs are already so simple and easy to use that as a practical matter you don't gain that much from relying on packrat parsing. LPeg, the standard PEG library in Lua, doesn't implement packrat and I don't recall anybody ever complaining about that. In fact, LPeg provides exceptionally useful extensions, like match-time captures, that I think might be incompatible with packrat memoization. Those features make it possible to write grammars for things like ASN.1 BER (with a TLV syntax), which otherwise would be impossible (or at least impractical) for PEGs to parse.