diff options
author | Marius <mariausol@gmail.com> | 2013-09-30 21:00:37 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-09-30 21:00:37 +0300 |
commit | fc15d93f32bf84b94217ab306a452d3a39ee4063 (patch) | |
tree | b129c66bb27eaed588cf688a351ce740160ab1a7 /tex/context/base/l-lpeg.lua | |
parent | 8e052e94b8b3ca08900ab4fe0a5bf110f6a52327 (diff) | |
download | context-fc15d93f32bf84b94217ab306a452d3a39ee4063.tar.gz |
beta 2013.09.30 19:49
Diffstat (limited to 'tex/context/base/l-lpeg.lua')
-rw-r--r-- | tex/context/base/l-lpeg.lua | 3 |
1 files changed, 3 insertions, 0 deletions
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 |