[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LPeg - stack overflow (too many runtime captures) with match time capture
- From: leaf corcoran <leafot@...>
- Date: Wed, 15 Jun 2011 13:29:05 -0700
The code you gave works great for my example, but what if I want to
access the value of the capture in the function at match time? What I
am trying to do it change the parsing path taken based on validation
done in the match time function.
On Wed, Jun 15, 2011 at 11:16 AM, Roberto Ierusalimschy
>> I have a relatively simple contrived grammar (below) which works great
>> with small files.
>> When I try to feed it a large file though I get an error:
>> stack overflow (too many runtime captures)
> You may try something like this: (Warning: untested code!!)
> - Name = Cmt(Name, function(str, pos, name)
> - count = count + 1
> - return true, name
> - end)
> + Name = C(Cmt(Name, function(str, pos)
> + count = count + 1
> + return true
> + end))
> That is, get the name as a regular capture, instead of a runtime one.
> -- Roberto