[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LPEG debugger conflicts with folding captures (was: LPEG-based relaxed parsing again)
- From: Rostislav Sacek <rosasoft@...>
- Date: Sat, 6 Sep 2014 19:08:22 +0000 (UTC)
Paul K <paul <at> zerobrane.com> writes:
>
> It turned out that the lpeg debugger (and the proposed mechanism)
> somehow conflicts with folding captures. I made a small fix to the
> debugger, but even with the fix it produces the wrong result as it
> only gets the first value from the fold
>
...
>
> Any suggestions as to what I may be doing wrong here? Thank you.
>
Problem is in combination lpeg.Cmt (used in debugger) and folder capture.
lpeg.Cmt nested returned capture values inside a group capture (like
lpeg.Cg). lpeg.Cf takes only first capture from this as accumulator and
not call folder function, because remaining list of captures is empty.
This is correct behaviour of lpeg.
Rostislav