summaryrefslogtreecommitdiff
path: root/tex/generic
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-12-06 01:21:00 +0100
committerHans Hagen <pragma@wxs.nl>2012-12-06 01:21:00 +0100
commitaa7af748bc475891fb91683ea1708f6db79cfbb0 (patch)
treed926a40eee9feba9625fdaa71cae3def0b62a3c7 /tex/generic
parent5843319486b908403bd682c57f5b446b31dd121f (diff)
downloadcontext-aa7af748bc475891fb91683ea1708f6db79cfbb0.tar.gz
beta 2012.12.06 01:21
Diffstat (limited to 'tex/generic')
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua20
1 files changed, 14 insertions, 6 deletions
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 8ca138458..219cbbc9d 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 12/05/12 15:00:04
+-- merge date : 12/06/12 01:21:29
do -- begin closure to overcome local limits and interference
@@ -1604,7 +1604,8 @@ end
-- Just for fun I looked at the used bytecode and
-- p = (p and p + pp) or pp gets one more (testset).
-function lpeg.replacer(one,two)
+function lpeg.replacer(one,two,makefunction)
+ local pattern
if type(one) == "table" then
local no = #one
local p = P(false)
@@ -1612,22 +1613,29 @@ function lpeg.replacer(one,two)
for k, v in next, one do
p = p + P(k) / v
end
- return Cs((p + 1)^0)
+ pattern = Cs((p + 1)^0)
elseif no == 1 then
local o = one[1]
one, two = P(o[1]), o[2]
- return Cs(((1-one)^1 + one/two)^0)
+ pattern = Cs(((1-one)^1 + one/two)^0)
else
for i=1,no do
local o = one[i]
p = p + P(o[1]) / o[2]
end
- return Cs((p + 1)^0)
+ pattern = Cs((p + 1)^0)
end
else
one = P(one)
two = two or ""
- return Cs(((1-one)^1 + one/two)^0)
+ pattern = Cs(((1-one)^1 + one/two)^0)
+ end
+ if makefunction then
+ return function(str)
+ return lpegmatch(pattern,str)
+ end
+ else
+ return pattern
end
end