summaryrefslogtreecommitdiff
path: root/lualibs-lpeg.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-11-03 12:58:28 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2013-11-03 12:58:28 +0100
commit137c28853effaf60c5c20884417643f671c79514 (patch)
tree28f6dcb7faf598e9d548f91d1a1ad5d170a17c7f /lualibs-lpeg.lua
parentd96d015887e6fcbe1ca8defcec44cb794421785d (diff)
downloadlualibs-137c28853effaf60c5c20884417643f671c79514.tar.gz
sync with Context as of 2013-11-03
Diffstat (limited to 'lualibs-lpeg.lua')
-rw-r--r--lualibs-lpeg.lua3
1 files changed, 3 insertions, 0 deletions
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