[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua to LPEG?
- From: Dirk Laurie <dpl@...>
- Date: Tue, 21 Jun 2011 10:51:47 +0200
On Tue, Jun 21, 2011 at 10:03:04AM +0200, steve donovan wrote:
> On Tue, Jun 21, 2011 at 9:37 AM, Dirk Laurie <firstname.lastname@example.org> wrote:
> > Instead, I'm asking whether a question similar to this has burgeoned
> > in the brain of a list member for long enough that some work in this
> > direction has been done.
> Ah, but what would be gained from getting _identical functionality_?
> We already have Lua patterns.(And there's always lpeg.re)
1. We're gaining immediate reusability of Lua pattern expertise, which
many people have.
2. Lua's character classes become available to LPEG.
> Now, if it could work with Lua patterns + alternation, say, then that
> would be worth expending some cycles on.
Once it's an LPEG pattern, all the operators are available.
pat1 = lpeg.L(lpat1)
pat2 = lpeg.L(lpat2)
pat1+pat2 -- pat1 or pat2
pat1-pat2 -- pat1 unless pat2