lua-users home
lua-l archive

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


On Fri, May 29, 2015 at 5:53 AM, Александр Машин <alex.mashin@gmail.com> wrote:

> Unfortunately, not. The grammar splits the input line into chunks, which
> have to be re-concatenated to get what I wanted as 'full' field. Iwas able
> to achieve it in a simpler form but hoped to avoid this second step.

I don't know a simple way to do what you want.  It might be possible
by using function captures, and/or match time function captures, but I
consider the chucks to be simpler.

It might also be possible to write two patterns, and call LPeg twice.
First to do the "full" match, and then a second time to get the
"items" (and "separator").

> In
> addition, 'Name::' is not inserted, although with this chunked input this is
> not necessary.

I see Name:: inserted into the chunks.  Do you really not see it?

Good luck!

-Parke