lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Paul K <paul <at>> 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.