summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-10-28 21:04:56 +0000
committerKarl Berry <karl@freefriends.org>2018-10-28 21:04:56 +0000
commitb66ea0d4e8536692eab3deb715a0b87a88a4b506 (patch)
tree2d6c32e517e191c6b9278cf1d260e998bc90efd9 /Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua
parentcc272ef6384ce91e8195ee19a50bf3d81bf22176 (diff)
luaotfload (28oct18)
git-svn-id: svn://tug.org/texlive/trunk@49010 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua20
1 files changed, 18 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua
index 750d5e698d7..589fa2b0b22 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua
@@ -308,12 +308,28 @@ function lpeg.instringchecker(p)
end
end
+-- function lpeg.splitter(pattern, action)
+-- return (((1-P(pattern))^1)/action+1)^0
+-- end
+
+-- function lpeg.tsplitter(pattern, action)
+-- return Ct((((1-P(pattern))^1)/action+1)^0)
+-- end
+
function lpeg.splitter(pattern, action)
- return (((1-P(pattern))^1)/action+1)^0
+ if action then
+ return (((1-P(pattern))^1)/action+1)^0
+ else
+ return (Cs((1-P(pattern))^1)+1)^0
+ end
end
function lpeg.tsplitter(pattern, action)
- return Ct((((1-P(pattern))^1)/action+1)^0)
+ if action then
+ return Ct((((1-P(pattern))^1)/action+1)^0)
+ else
+ return Ct((Cs((1-P(pattern))^1)+1)^0)
+ end
end
-- probleem: separator can be lpeg and that does not hash too well, but