From 854fa35fc4ede90cf35dae564298a94f8f99d8a4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 21 Oct 2018 20:36:09 +0000 Subject: lualibs (21oct18) git-svn-id: svn://tug.org/texlive/trunk@48965 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/luatex/lualibs/lualibs-lpeg.lua | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'Master/texmf-dist/tex/luatex/lualibs/lualibs-lpeg.lua') diff --git a/Master/texmf-dist/tex/luatex/lualibs/lualibs-lpeg.lua b/Master/texmf-dist/tex/luatex/lualibs/lualibs-lpeg.lua index 750d5e698d7..589fa2b0b22 100644 --- a/Master/texmf-dist/tex/luatex/lualibs/lualibs-lpeg.lua +++ b/Master/texmf-dist/tex/luatex/lualibs/lualibs-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 -- cgit v1.2.3