From 137c28853effaf60c5c20884417643f671c79514 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 3 Nov 2013 12:58:28 +0100 Subject: sync with Context as of 2013-11-03 --- lualibs-lpeg.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lualibs-lpeg.lua') diff --git a/lualibs-lpeg.lua b/lualibs-lpeg.lua index 58c5524..399b3ad 100644 --- a/lualibs-lpeg.lua +++ b/lualibs-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