[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lpeg recursive patterns, bug ?
- From: Tony Finch <dot@...>
- Date: Mon, 21 Feb 2011 14:26:11 +0000
On Mon, 21 Feb 2011, Wim Langers wrote:
> The actual pattern creates objects from the match time captures. Since the
> data has a tree structure these objects combined with other data generate
> encapsulating objects etc...
That doesn't require match-time captures. You only need match-time
captures if you need to use Lua code to determine whether or not a match
occurred. Just constructing a parse tree should be done with normal
> Your explanation sounds logical (given my very limited knowledge of LPEG),
> but then why does the following example behave "as expected" (my pattern
> further stripped down) ?
No match-time captures. Normal captures are evaluated after matching has
completed, after all backtracking has been resolved.
f.anthony.n.finch <email@example.com> http://dotat.at/
Irish Sea: Southeast 4 or 5, occasionally 6 at first. Moderate becoming
slight. Occasional rain. Moderate or good, occasionally poor.