[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Lpeg question
- From: Shmuel Zeigerman <shmuz@...>
- Date: Thu, 04 Oct 2007 15:39:38 +0200
I noticed that when matching the following pattern:
patt1 / func1 * lpeg.P(func2) * patt2 * patt3
func2 is called before func1, moreover, if func2() returns nil,
then func1 isn't called at all. While this behavior seems
reasonable, I fail to find it mentioned somewhere in the manual.
And the question is: how to make results of func2() depend on
the captures of patt1 ? For example, when matching
"if" * expression * "then" * block * "end",
one needs to know the value of expression before matching block.
--
Shmuel