lua-users home
lua-l archive

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


On Wed, May 14, 2014 at 8:44 AM, Chris Emerson
<chris-lua@mail.nosreme.org> wrote:
> On Tue, May 13, 2014 at 07:40:13PM -0500, Andrew Starks wrote:
>> Is it something like: "these are still individual captures, but for the
>> purposes of numbering, they're grouped, which makes it possible to
>> specify a subset of captures from a set."
>>
>> The first time I heard of "formal grammars" or a parsing expression grammar
>> was after I read a bit about LPeg. So, from that perspective:
>>
>> The text lead me to believe that Cg was defined verbosely as "concatenates
>> captures into a single value."
>
> I guess it's more a single capture with multiple values.
>
>> An example in the LPeg doc or a clarifying disclaimer would have been
>> appreciated, but your answer is great too!
>
> There is one example at http://www.inf.puc-rio.br/~roberto/lpeg/ ; see the
> "Name-value lists" example, where two captures inside a Cg end up being
> passed as separate parameters to rawset().
>
> Chris
>

Thank you! That is perfect and I missed that. I think as I was
scanning, the use case of Ct and Cg(patt, "name") stepped in to make
me conclude that this example wasn't getting at the anonymous use of
it. But there it is.

I am in your debt, and Roberto's, of course.

--Andrew