diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-05-12 18:43:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-05-12 18:43:00 +0200 |
commit | 8c0bb98e13632d6caf24fd08261ff4bca4fdd4eb (patch) | |
tree | 79c561dbc438a8e8089e289aa89710ee4783cee1 /tex/generic | |
parent | 8ad1a9bed2cf3271f1922759060c2ba1c8e3ced1 (diff) | |
download | context-8c0bb98e13632d6caf24fd08261ff4bca4fdd4eb.tar.gz |
beta 2010.05.12 18:43
Diffstat (limited to 'tex/generic')
-rw-r--r-- | tex/generic/context/luatex-fonts-merged.lua | 22 |
1 files changed, 21 insertions, 1 deletions
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 |