[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [LPeg] intermittent stack exhaustion
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 13 Sep 2016 11:32:11 -0300
> Here's a patch for it, including the part from the previous e-mail
> about not compiling unreferenced rules. It passes lpeg-1.0.0/test.lua,
> and no segfault.
I think you are right about not being necessary to follow the next
rule (sib2 of TRule), but we still need to control recursion in
TCall nodes (as I said in the previous message). Try the following
grammar with your patch:
p = lpeg.C(-lpeg.P{lpeg.P'x' * lpeg.V(1) + lpeg.P'y'})
p:match("xx")
-- Roberto