diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-07-06 23:20:08 +0200 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-07-06 23:20:08 +0200 |
commit | 721459ab3de4766f852db44fc0f044037e64dfeb (patch) | |
tree | b67068a39a67b3ff15041df6ab7f73add9be33da | |
parent | f837641ae86abcd8fa127b0918c7c2389698b3ec (diff) | |
download | luaotfload-721459ab3de4766f852db44fc0f044037e64dfeb.tar.gz |
[fontloader] sync with Context as of 2014-07-06
-rw-r--r-- | src/luaotfload-fontloader.lua | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/src/luaotfload-fontloader.lua b/src/luaotfload-fontloader.lua index a62958c..2f26be7 100644 --- a/src/luaotfload-fontloader.lua +++ b/src/luaotfload-fontloader.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 07/03/14 14:52:08 +-- merge date : 07/06/14 22:50:12 do -- begin closure to overcome local limits and interference @@ -665,17 +665,34 @@ end function lpeg.utfchartabletopattern(list) local tree={} local hash={} - for i=1,#list do - local t=tree - for c in gmatch(list[i],".") do - local tc=t[c] - if not tc then - tc={} - t[c]=tc + local n=#list + if n==0 then + for s in next,list do + local t=tree + for c in gmatch(s,".") do + local tc=t[c] + if not tc then + tc={} + t[c]=tc + end + t=tc + end + hash[t]=s + end + else + for i=1,n do + local t=tree + local s=list[i] + for c in gmatch(s,".") do + local tc=t[c] + if not tc then + tc={} + t[c]=tc + end + t=tc end - t=tc + hash[t]=s end - hash[t]=list[i] end return make(tree,hash) end |