lua-users home
lua-l archive

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


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