From 06a1c5537e6643f260001bab92777dfcbaa3d00f Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sat, 20 Oct 2012 02:07:00 +0200 Subject: beta 2012.10.20 02:07 --- scripts/context/lua/mtxrun.lua | 60 ++++------ scripts/context/stubs/mswin/mtxrun.lua | 60 ++++------ scripts/context/stubs/unix/mtxrun | 60 ++++------ tex/context/base/attr-ini.mkiv | 4 +- tex/context/base/back-exp.lua | 36 +++--- tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4140 -> 4138 bytes tex/context/base/context-version.png | Bin 105499 -> 104769 bytes tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 2 +- tex/context/base/font-ota.lua | 2 +- tex/context/base/font-otn.lua | 44 +++---- tex/context/base/l-lpeg.lua | 48 ++------ tex/context/base/l-string.lua | 2 +- tex/context/base/l-table.lua | 10 ++ tex/context/base/lang-txt.lua | 88 ++++++++++---- tex/context/base/luat-mac.lua | 34 +++++- tex/context/base/node-fin.lua | 24 ++-- tex/context/base/node-inj.lua | 4 +- tex/context/base/node-ref.lua | 36 +++--- tex/context/base/node-shp.lua | 106 ++++++++++++++--- tex/context/base/regi-ini.lua | 99 +++++++++++++++- tex/context/base/spac-ver.lua | 66 +++++++---- tex/context/base/spac-ver.mkiv | 61 ++++++++-- tex/context/base/status-files.pdf | Bin 24585 -> 24568 bytes tex/context/base/status-lua.pdf | Bin 195620 -> 195680 bytes tex/context/base/strc-not.mkvi | 19 ++- tex/context/base/tabl-tbl.mkiv | 131 +++++++++++++++++---- tex/context/base/util-sql.lua | 2 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 112 ++++++++---------- 31 files changed, 714 insertions(+), 402 deletions(-) diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index e6bbbe2b5..b3170f7b2 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -171,7 +171,7 @@ string.itself = function(s) return s end -- also handy (see utf variant) -local pattern = Ct(C(1)^0) +local pattern = Ct(C(1)^0) -- string and not utf ! function string.totable(str) return lpegmatch(pattern,str) @@ -330,6 +330,16 @@ local function sortedhashkeys(tab) -- fast one end end +function table.allkeys(t) + local keys = { } + for i=1,#t do + for k, v in next, t[i] do + keys[k] = true + end + end + return sortedkeys(keys) +end + table.sortedkeys = sortedkeys table.sortedhashkeys = sortedhashkeys @@ -1581,15 +1591,10 @@ end function lpeg.replacer(one,two) if type(one) == "table" then local no = #one - local p + local p = P(false) if no == 0 then for k, v in next, one do - local pp = P(k) / v - if p then - p = p + pp - else - p = pp - end + p = p + P(k) / v end return Cs((p + 1)^0) elseif no == 1 then @@ -1599,12 +1604,7 @@ function lpeg.replacer(one,two) else for i=1,no do local o = one[i] - local pp = P(o[1]) / o[2] - if p then - p = p + pp - else - p = pp - end + p = p + P(o[1]) / o[2] end return Cs((p + 1)^0) end @@ -1721,13 +1721,9 @@ lpeg.UP = lpeg.P if utfcharacters then function lpeg.US(str) - local p + local p = P(false) for uc in utfcharacters(str) do - if p then - p = p + P(uc) - else - p = P(uc) - end + p = p + P(uc) end return p end @@ -1736,13 +1732,9 @@ if utfcharacters then elseif utfgmatch then function lpeg.US(str) - local p + local p = P(false) for uc in utfgmatch(str,".") do - if p then - p = p + P(uc) - else - p = P(uc) - end + p = p + P(uc) end return p end @@ -1750,13 +1742,9 @@ elseif utfgmatch then else function lpeg.US(str) - local p + local p = P(false) local f = function(uc) - if p then - p = p + P(uc) - else - p = P(uc) - end + p = p + P(uc) end lpegmatch((utf8char/f)^0,str) return p @@ -1782,13 +1770,9 @@ function lpeg.UR(str,more) if first == last then return P(str) elseif utfchar and last - first < 8 then -- a somewhat arbitrary criterium - local p + local p = P(false) for i=first,last do - if p then - p = p + P(utfchar(i)) - else - p = P(utfchar(i)) - end + p = p + P(utfchar(i)) end return p -- nil when invalid range else diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index e6bbbe2b5..b3170f7b2 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -171,7 +171,7 @@ string.itself = function(s) return s end -- also handy (see utf variant) -local pattern = Ct(C(1)^0) +local pattern = Ct(C(1)^0) -- string and not utf ! function string.totable(str) return lpegmatch(pattern,str) @@ -330,6 +330,16 @@ local function sortedhashkeys(tab) -- fast one end end +function table.allkeys(t) + local keys = { } + for i=1,#t do + for k, v in next, t[i] do + keys[k] = true + end + end + return sortedkeys(keys) +end + table.sortedkeys = sortedkeys table.sortedhashkeys = sortedhashkeys @@ -1581,15 +1591,10 @@ end function lpeg.replacer(one,two) if type(one) == "table" then local no = #one - local p + local p = P(false) if no == 0 then for k, v in next, one do - local pp = P(k) / v - if p then - p = p + pp - else - p = pp - end + p = p + P(k) / v end return Cs((p + 1)^0) elseif no == 1 then @@ -1599,12 +1604,7 @@ function lpeg.replacer(one,two) else for i=1,no do local o = one[i] - local pp = P(o[1]) / o[2] - if p then - p = p + pp - else - p = pp - end + p = p + P(o[1]) / o[2] end return Cs((p + 1)^0) end @@ -1721,13 +1721,9 @@ lpeg.UP = lpeg.P if utfcharacters then function lpeg.US(str) - local p + local p = P(false) for uc in utfcharacters(str) do - if p then - p = p + P(uc) - else - p = P(uc) - end + p = p + P(uc) end return p end @@ -1736,13 +1732,9 @@ if utfcharacters then elseif utfgmatch then function lpeg.US(str) - local p + local p = P(false) for uc in utfgmatch(str,".") do - if p then - p = p + P(uc) - else - p = P(uc) - end + p = p + P(uc) end return p end @@ -1750,13 +1742,9 @@ elseif utfgmatch then else function lpeg.US(str) - local p + local p = P(false) local f = function(uc) - if p then - p = p + P(uc) - else - p = P(uc) - end + p = p + P(uc) end lpegmatch((utf8char/f)^0,str) return p @@ -1782,13 +1770,9 @@ function lpeg.UR(str,more) if first == last then return P(str) elseif utfchar and last - first < 8 then -- a somewhat arbitrary criterium - local p + local p = P(false) for i=first,last do - if p then - p = p + P(utfchar(i)) - else - p = P(utfchar(i)) - end + p = p + P(utfchar(i)) end return p -- nil when invalid range else diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index e6bbbe2b5..b3170f7b2 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -171,7 +171,7 @@ string.itself = function(s) return s end -- also handy (see utf variant) -local pattern = Ct(C(1)^0) +local pattern = Ct(C(1)^0) -- string and not utf ! function string.totable(str) return lpegmatch(pattern,str) @@ -330,6 +330,16 @@ local function sortedhashkeys(tab) -- fast one end end +function table.allkeys(t) + local keys = { } + for i=1,#t do + for k, v in next, t[i] do + keys[k] = true + end + end + return sortedkeys(keys) +end + table.sortedkeys = sortedkeys table.sortedhashkeys = sortedhashkeys @@ -1581,15 +1591,10 @@ end function lpeg.replacer(one,two) if type(one) == "table" then local no = #one - local p + local p = P(false) if no == 0 then for k, v in next, one do - local pp = P(k) / v - if p then - p = p + pp - else - p = pp - end + p = p + P(k) / v end return Cs((p + 1)^0) elseif no == 1 then @@ -1599,12 +1604,7 @@ function lpeg.replacer(one,two) else for i=1,no do local o = one[i] - local pp = P(o[1]) / o[2] - if p then - p = p + pp - else - p = pp - end + p = p + P(o[1]) / o[2] end return Cs((p + 1)^0) end @@ -1721,13 +1721,9 @@ lpeg.UP = lpeg.P if utfcharacters then function lpeg.US(str) - local p + local p = P(false) for uc in utfcharacters(str) do - if p then - p = p + P(uc) - else - p = P(uc) - end + p = p + P(uc) end return p end @@ -1736,13 +1732,9 @@ if utfcharacters then elseif utfgmatch then function lpeg.US(str) - local p + local p = P(false) for uc in utfgmatch(str,".") do - if p then - p = p + P(uc) - else - p = P(uc) - end + p = p + P(uc) end return p end @@ -1750,13 +1742,9 @@ elseif utfgmatch then else function lpeg.US(str) - local p + local p = P(false) local f = function(uc) - if p then - p = p + P(uc) - else - p = P(uc) - end + p = p + P(uc) end lpegmatch((utf8char/f)^0,str) return p @@ -1782,13 +1770,9 @@ function lpeg.UR(str,more) if first == last then return P(str) elseif utfchar and last - first < 8 then -- a somewhat arbitrary criterium - local p + local p = P(false) for i=first,last do - if p then - p = p + P(utfchar(i)) - else - p = P(utfchar(i)) - end + p = p + P(utfchar(i)) end return p -- nil when invalid range else diff --git a/tex/context/base/attr-ini.mkiv b/tex/context/base/attr-ini.mkiv index 8a41dd427..377960f9f 100644 --- a/tex/context/base/attr-ini.mkiv +++ b/tex/context/base/attr-ini.mkiv @@ -85,10 +85,10 @@ %D For the moment we put this here (later it will move to where it's used): \definesystemattribute [state] +\definesystemattribute [color] [public] +\definesystemattribute [colormodel] [public,global] \definesystemattribute [skip] \definesystemattribute [penalty] -\definesystemattribute [colormodel] [public,global] -\definesystemattribute [color] [public] \definesystemattribute [transparency] [public] \definesystemattribute [background] [public] \definesystemattribute [colorintent] [public] diff --git a/tex/context/base/back-exp.lua b/tex/context/base/back-exp.lua index 46ce4f96c..56d300ba3 100644 --- a/tex/context/base/back-exp.lua +++ b/tex/context/base/back-exp.lua @@ -1937,24 +1937,6 @@ local function collectresults(head,list) -- is last used (we also have currentat end end end - elseif id == hlist_code or id == vlist_code then - local ai = has_attribute(n,a_image) - if ai then - local at = has_attribute(n,a_tagged) - if nofcurrentcontent > 0 then - pushcontent() - pushentry(currentnesting) -- ?? - end - pushentry(taglist[at]) -- has an index, todo: flag empty element - if trace_export then - report_export("%s