diff options
author | Marius <mariausol@gmail.com> | 2012-12-06 20:00:13 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2012-12-06 20:00:13 +0200 |
commit | 7490fa4d0750f6f5769e53f84aba9c263479a48e (patch) | |
tree | c8d1e8f0f816009cb79238a636d9db3d4954f7ea /tex/generic | |
parent | c5eeba726820e576380fadff494ce494b625b6ae (diff) | |
download | context-7490fa4d0750f6f5769e53f84aba9c263479a48e.tar.gz |
beta 2012.12.06 18:39
Diffstat (limited to 'tex/generic')
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index e4c16421f..e29b47f55 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/06/12 15:01:05 +-- merge date : 12/06/12 18:39:21 do -- begin closure to overcome local limits and interference @@ -2252,20 +2252,6 @@ function file.replacesuffix(filename, suffix) return (gsub(filename,"%.[%a%d]+$","")) .. "." .. suffix end ---~ function file.join(...) ---~ local pth = concat({...},"/") ---~ pth = gsub(pth,"\\","/") ---~ local a, b = match(pth,"^(.*://)(.*)$") ---~ if a and b then ---~ return a .. gsub(b,"//+","/") ---~ end ---~ a, b = match(pth,"^(//)(.*)$") ---~ if a and b then ---~ return a .. gsub(b,"//+","/") ---~ end ---~ return (gsub(pth,"//+","/")) ---~ end - local trick_1 = char(1) local trick_2 = "^" .. trick_1 .. "/+" @@ -2292,15 +2278,44 @@ function file.join(...) -- rather dirty return (gsub(pth,"//+","/")) end ---~ print(file.join("//","/y")) ---~ print(file.join("/","/y")) ---~ print(file.join("","/y")) ---~ print(file.join("/x/","/y")) ---~ print(file.join("x/","/y")) ---~ print(file.join("http://","/y")) ---~ print(file.join("http://a","/y")) ---~ print(file.join("http:///a","/y")) ---~ print(file.join("//nas-1","/y")) +-- local slash = P("/") +-- local colon = P(":") + +-- local replacer = lpeg.replacer(S("\\/")^1,"/") +-- local stripper = Cs(P(slash)^0/"" * replacer) +-- local isnetwork = slash * slash * (1-slash) + (1-slash-colon)^1 * colon +-- local isroot = slash^1 * -1 +-- local hasroot = slash^1 + +-- function file.newjoin(...) -- rather dirty +-- local lst = { ... } +-- local one = lst[1] +-- if lpegmatch(isnetwork,one) then +-- local two = lpegmatch(replacer,concat(lst,"/",2)) +-- return one .. two +-- elseif lpegmatch(isroot,one) then +-- local two = lpegmatch(replacer,concat(lst,"/",2)) +-- if lpegmatch(hasroot,two) then +-- return two +-- else +-- return "/" .. two +-- end +-- elseif one == "" then +-- return lpegmatch(stripper,concat(lst,"/",2)) +-- else +-- return lpegmatch(replacer,concat(lst,"/")) +-- end +-- end + +-- print(file.join("//","/y")) +-- print(file.join("/","/y")) +-- print(file.join("","/y")) +-- print(file.join("/x/","/y")) +-- print(file.join("x/","/y")) +-- print(file.join("http://","/y")) +-- print(file.join("http://a","/y")) +-- print(file.join("http:///a","/y")) +-- print(file.join("//nas-1","/y")) -- We should be able to use: -- |