From 136826a4dc6e9505ed1ff1cfa6c862451a4a280a Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 3 May 2015 22:30:08 +0200 Subject: [fontloader] sync with Context as of 2015-05-03 --- src/fontloader/runtime/fontloader-fontloader.lua | 27 +++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/fontloader/runtime') diff --git a/src/fontloader/runtime/fontloader-fontloader.lua b/src/fontloader/runtime/fontloader-fontloader.lua index 1d6509a..fba5742 100644 --- a/src/fontloader/runtime/fontloader-fontloader.lua +++ b/src/fontloader/runtime/fontloader-fontloader.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 04/18/15 14:41:50 +-- merge date : 05/01/15 18:45:14 do -- begin closure to overcome local limits and interference @@ -699,6 +699,31 @@ local function make(t) end return p end +local function collapse(t,x) + if type(t)~="table" then + return t,x + else + local n=next(t) + if n==nil then + return t,x + elseif next(t,n)==nil then + local k=n + local v=t[k] + if type(v)=="table" then + return collapse(v,x..k) + else + return v,x..k + end + else + local tt={} + for k,v in next,t do + local vv,kk=collapse(v,k) + tt[kk]=vv + end + return tt,x + end + end +end function lpeg.utfchartabletopattern(list) local tree={} local n=#list -- cgit v1.2.3