[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LPeg: named captures within a named capture ?
- From: Philippe Rathé <prathe@...>
- Date: Fri, 29 Jun 2012 10:42:44 -0400
> How about this:
>
> space = P" "^0
> token = (R"az")^1
> header = Cg(token, "first") * space * Cg(token, "second")
> headerRedundant = Ct(#Cg(header, "whole") * header)
Hello lpeg folks, the proposed code does not return the wanted result.
headerRedundant:match("x y")
Actual:
{
first = 'x',
second = 'y'
}
Expected:
{
first = 'x',
second = 'y',
whole = 'x y'
}
Any idea how to achieve the expected results?
Thanks
--
-- Philippe