[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [LPeg] Can LPeg be hooked?
- From: Nagaev Boris <bnagaev@...>
- Date: Mon, 18 Jul 2016 00:11:33 +0300
On Sun, Jul 17, 2016 at 11:09 PM, Soni L. <email@example.com> wrote:
> Can I wrap the LPeg module table and hook everything that gets passed into
> LPeg so I can build a visual representation of the parsing/matching process
> and stuff?
> It'd look cool.
> 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.
I have created emulator of "lpeg" module  as a part of lpjit, JIT
compiler of LPeg patterns . This module is a drop-in replacement
for standard "lpeg" module. When match() method is called, a pattern
is passed to lpjit.compile , which produces machine code for the
pattern. The wrapper passes LPeg test suite.