[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: make lpeg.P(table) recursive?
- From: Pierre-Yves Gérardy <pygy79@...>
- Date: Wed, 6 Apr 2011 22:17:24 +0200
Hi all, and especially Roberto,
Changing the line #1188 in the "fix_l" function definition from
"luaLerror(...);"
to
getpatt(L, lua_gettop(L), NULL);
makes lpeg.P(table) recursive ie it applies P to anything that's not already a pattern.
I only made some rudimentary tests, but I don't see any drawback so far. This makes grammar composition a bit easier, which is useful for a project I'm working on, and allows to get rid of calls to P that don't add much, semantically...
Assuming it is indeed harmless, would you mind making the change?
Kind regards,
-- Pierre-Yves