lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 03/09/16 02:30 AM, Matt the Undecidable Robot wrote:
On 7/30/16, Soni L. <fakedme@gmail.com> wrote:
I'm writing an LPeg-based parser. How can I make it so a parsing error
returns `nil, errmsg`?
I hope it's not too late for me to reply, but I just wanted to let you
know of a better solution to your problem by using LPegLabel[1].
Please see my answers to your question on stackoverflow for the
details.

I also want to give a little more detail on LPegLabel. LPegLabel is an
extension of LPeg (1.0) so it can be used as a drop-in replacement for
LPeg. You can easily get the latest version on LuaRocks. LPegLabel is
developed by Professor Sérgio Medeiros under LabLua, and I worked on
rewriting a few grammars to use LPegLabel for my Google Summer of
Code. Please let me know of any issues you encounter with it.
LPegLabel is quite young, so we really appreciate any feedback we can
get.

   [1]: https://github.com/sqmedeiros/lpeglabel

Is it still LPeg if it's not LPeg?I'm pretty sure I can't use LPegLabel in things that only come with standard LPeg built-in. That is, I'm pretty sure LPegLabel doesn't come built into Luvit and I'd have to install it as yet another useless external dependency that's about 95% redundant, because Luvit includes LPeg by default.

Is a pure-LPeg solution too hard?

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.