From 8c0bb98e13632d6caf24fd08261ff4bca4fdd4eb Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 12 May 2010 18:43:00 +0200 Subject: beta 2010.05.12 18:43 --- tex/generic/context/luatex-fonts-merged.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tex/generic') diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 3e3e7c34c..dc3e8c7c9 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 05/08/10 13:33:54 +-- merge date : 05/12/10 18:43:22 do -- begin closure to overcome local limits and interference @@ -394,6 +394,15 @@ lpeg.splitat = splitat local cache = { } +function lpeg.split(separator,str) + local c = cache[separator] + if not c then + c = Ct(splitat(separator)) + cache[separator] = c + end + return match(c,str) +end + function string:split(separator) local c = cache[separator] if not c then @@ -405,6 +414,17 @@ end local cache = { } +function lpeg.checkedsplit(separator,str) + local c = cache[separator] + if not c then + separator = P(separator) + local other = C((1 - separator)^0) + c = Ct(separator^0 * other * (separator^1 * other)^0) + cache[separator] = c + end + return match(c,str) +end + function string:checkedsplit(separator) local c = cache[separator] if not c then -- cgit v1.2.3