From fc15d93f32bf84b94217ab306a452d3a39ee4063 Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 30 Sep 2013 21:00:37 +0300 Subject: beta 2013.09.30 19:49 --- tex/context/base/l-lpeg.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tex/context/base/l-lpeg.lua') diff --git a/tex/context/base/l-lpeg.lua b/tex/context/base/l-lpeg.lua index 58c552419..399b3ad65 100644 --- a/tex/context/base/l-lpeg.lua +++ b/tex/context/base/l-lpeg.lua @@ -466,6 +466,9 @@ function lpeg.replacer(one,two,makefunction,isutf) -- in principle we should sor end end +-- local pattern1 = P(1-P(pattern))^0 * P(pattern) : test for not nil +-- local pattern2 = (P(pattern) * Cc(true) + P(1))^0 : test for true (could be faster, but not much) + function lpeg.finder(lst,makefunction) -- beware: slower than find with 'patternless finds' local pattern if type(lst) == "table" then -- cgit v1.2.3