diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-08-24 16:17:31 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-08-24 16:17:31 +0200 |
commit | 919bc064f39878b9624c6e48b4695c74608359e4 (patch) | |
tree | a88e5f38e8f08b5c56926fc24eb136ae7a9ca343 | |
parent | 283022d997abb0ceb63f582d4708d03920f999d1 (diff) | |
download | context-919bc064f39878b9624c6e48b4695c74608359e4.tar.gz |
2016-08-24 15:42:00
18 files changed, 198 insertions, 108 deletions
diff --git a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex index 7d19d7713..821942a9a 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex @@ -1879,7 +1879,6 @@ this: \NC \type {set_attribute} \NC \yes \NC \yes \NC \NR \NC \type {setboth} \NC \yes \NC \yes \NC \NR \NC \type {setbox} \NC \nop \NC \yes \NC \NR -\NC \type {setbox} \NC \yes \NC \yes \NC \NR \NC \type {setchar} \NC \yes \NC \yes \NC \NR \NC \type {setdisc} \NC \yes \NC \yes \NC \NR \NC \type {setfield} \NC \yes \NC \yes \NC \NR diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 56f44bb5c..43b9a8d05 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -1389,7 +1389,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 37593, stripped down to: 22615 +-- original size: 37840, stripped down to: 22763 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1716,7 +1716,7 @@ function table.fromhash(t) end return hsh end -local noquotes,hexify,handle,compact,inline,functions +local noquotes,hexify,handle,compact,inline,functions,metacheck local reserved=table.tohash { 'and','break','do','else','elseif','end','false','for','function','if', 'in','local','nil','not','or','repeat','return','then','true','until','while', @@ -1786,7 +1786,7 @@ local function do_serialize(root,name,depth,level,indexed) if compact then last=#root for k=1,last do - if root[k]==nil then + if rawget(root,k)==nil then last=k-1 break end @@ -1983,6 +1983,7 @@ local function serialize(_handle,root,name,specification) functions=specification.functions compact=specification.compact inline=specification.inline and compact + metacheck=specification.metacheck if functions==nil then functions=true end @@ -1992,6 +1993,9 @@ local function serialize(_handle,root,name,specification) if inline==nil then inline=compact end + if metacheck==nil then + metacheck=true + end else noquotes=false hexify=false @@ -1999,6 +2003,7 @@ local function serialize(_handle,root,name,specification) compact=true inline=true functions=true + metacheck=true end if tname=="string" then if name=="return" then @@ -2022,7 +2027,7 @@ local function serialize(_handle,root,name,specification) handle("t={") end if root then - if getmetatable(root) then + if metacheck and getmetatable(root) then local dummy=root._w_h_a_t_e_v_e_r_ root._w_h_a_t_e_v_e_r_=nil end @@ -5926,7 +5931,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 28690, stripped down to: 18636 +-- original size: 29007, stripped down to: 18742 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -5940,7 +5945,7 @@ utilities.tables=utilities.tables or {} local tables=utilities.tables local format,gmatch,gsub,sub=string.format,string.gmatch,string.gsub,string.sub local concat,insert,remove,sort=table.concat,table.insert,table.remove,table.sort -local setmetatable,getmetatable,tonumber,tostring=setmetatable,getmetatable,tonumber,tostring +local setmetatable,getmetatable,tonumber,tostring,rawget=setmetatable,getmetatable,tonumber,tostring,rawget local type,next,rawset,tonumber,tostring,load,select=type,next,rawset,tonumber,tostring,load,select local lpegmatch,P,Cs,Cc=lpeg.match,lpeg.P,lpeg.Cs,lpeg.Cc local sortedkeys,sortedpairs=table.sortedkeys,table.sortedpairs @@ -6316,7 +6321,8 @@ function table.twowaymapper(t) if not t then t={} else - for i=0,#t do + local zero=rawget(t,0) + for i=zero or 1,#t do local ti=t[i] if ti then local i=tostring(i) @@ -6324,7 +6330,7 @@ function table.twowaymapper(t) t[ti]=i end end - t[""]=t[0] or "" + t[""]=zero or "" end setmetatable(t,selfmapper) return t @@ -6380,7 +6386,7 @@ local function serialize(root,name,specification) return nil end end - local haszero=t[0] + local haszero=rawget(t,0) if n==nt then local tt={} for i=1,nt do @@ -6442,7 +6448,7 @@ local function serialize(root,name,specification) local last=0 last=#root for k=1,last do - if root[k]==nil then + if rawget(root,k)==nil then last=k-1 break end @@ -6587,7 +6593,12 @@ local function serialize(root,name,specification) end table.serialize=serialize if setinspector then - setinspector("table",function(v) if type(v)=="table" then print(serialize(v,"table",{})) return true end end) + setinspector("table",function(v) + if type(v)=="table" then + print(serialize(v,"table",{ metacheck=false })) + return true + end + end) end @@ -18834,8 +18845,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 800533 --- stripped bytes : 290375 +-- original bytes : 801097 +-- stripped bytes : 290685 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 56f44bb5c..43b9a8d05 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -1389,7 +1389,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 37593, stripped down to: 22615 +-- original size: 37840, stripped down to: 22763 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1716,7 +1716,7 @@ function table.fromhash(t) end return hsh end -local noquotes,hexify,handle,compact,inline,functions +local noquotes,hexify,handle,compact,inline,functions,metacheck local reserved=table.tohash { 'and','break','do','else','elseif','end','false','for','function','if', 'in','local','nil','not','or','repeat','return','then','true','until','while', @@ -1786,7 +1786,7 @@ local function do_serialize(root,name,depth,level,indexed) if compact then last=#root for k=1,last do - if root[k]==nil then + if rawget(root,k)==nil then last=k-1 break end @@ -1983,6 +1983,7 @@ local function serialize(_handle,root,name,specification) functions=specification.functions compact=specification.compact inline=specification.inline and compact + metacheck=specification.metacheck if functions==nil then functions=true end @@ -1992,6 +1993,9 @@ local function serialize(_handle,root,name,specification) if inline==nil then inline=compact end + if metacheck==nil then + metacheck=true + end else noquotes=false hexify=false @@ -1999,6 +2003,7 @@ local function serialize(_handle,root,name,specification) compact=true inline=true functions=true + metacheck=true end if tname=="string" then if name=="return" then @@ -2022,7 +2027,7 @@ local function serialize(_handle,root,name,specification) handle("t={") end if root then - if getmetatable(root) then + if metacheck and getmetatable(root) then local dummy=root._w_h_a_t_e_v_e_r_ root._w_h_a_t_e_v_e_r_=nil end @@ -5926,7 +5931,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 28690, stripped down to: 18636 +-- original size: 29007, stripped down to: 18742 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -5940,7 +5945,7 @@ utilities.tables=utilities.tables or {} local tables=utilities.tables local format,gmatch,gsub,sub=string.format,string.gmatch,string.gsub,string.sub local concat,insert,remove,sort=table.concat,table.insert,table.remove,table.sort -local setmetatable,getmetatable,tonumber,tostring=setmetatable,getmetatable,tonumber,tostring +local setmetatable,getmetatable,tonumber,tostring,rawget=setmetatable,getmetatable,tonumber,tostring,rawget local type,next,rawset,tonumber,tostring,load,select=type,next,rawset,tonumber,tostring,load,select local lpegmatch,P,Cs,Cc=lpeg.match,lpeg.P,lpeg.Cs,lpeg.Cc local sortedkeys,sortedpairs=table.sortedkeys,table.sortedpairs @@ -6316,7 +6321,8 @@ function table.twowaymapper(t) if not t then t={} else - for i=0,#t do + local zero=rawget(t,0) + for i=zero or 1,#t do local ti=t[i] if ti then local i=tostring(i) @@ -6324,7 +6330,7 @@ function table.twowaymapper(t) t[ti]=i end end - t[""]=t[0] or "" + t[""]=zero or "" end setmetatable(t,selfmapper) return t @@ -6380,7 +6386,7 @@ local function serialize(root,name,specification) return nil end end - local haszero=t[0] + local haszero=rawget(t,0) if n==nt then local tt={} for i=1,nt do @@ -6442,7 +6448,7 @@ local function serialize(root,name,specification) local last=0 last=#root for k=1,last do - if root[k]==nil then + if rawget(root,k)==nil then last=k-1 break end @@ -6587,7 +6593,12 @@ local function serialize(root,name,specification) end table.serialize=serialize if setinspector then - setinspector("table",function(v) if type(v)=="table" then print(serialize(v,"table",{})) return true end end) + setinspector("table",function(v) + if type(v)=="table" then + print(serialize(v,"table",{ metacheck=false })) + return true + end + end) end @@ -18834,8 +18845,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 800533 --- stripped bytes : 290375 +-- original bytes : 801097 +-- stripped bytes : 290685 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 56f44bb5c..43b9a8d05 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -1389,7 +1389,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 37593, stripped down to: 22615 +-- original size: 37840, stripped down to: 22763 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1716,7 +1716,7 @@ function table.fromhash(t) end return hsh end -local noquotes,hexify,handle,compact,inline,functions +local noquotes,hexify,handle,compact,inline,functions,metacheck local reserved=table.tohash { 'and','break','do','else','elseif','end','false','for','function','if', 'in','local','nil','not','or','repeat','return','then','true','until','while', @@ -1786,7 +1786,7 @@ local function do_serialize(root,name,depth,level,indexed) if compact then last=#root for k=1,last do - if root[k]==nil then + if rawget(root,k)==nil then last=k-1 break end @@ -1983,6 +1983,7 @@ local function serialize(_handle,root,name,specification) functions=specification.functions compact=specification.compact inline=specification.inline and compact + metacheck=specification.metacheck if functions==nil then functions=true end @@ -1992,6 +1993,9 @@ local function serialize(_handle,root,name,specification) if inline==nil then inline=compact end + if metacheck==nil then + metacheck=true + end else noquotes=false hexify=false @@ -1999,6 +2003,7 @@ local function serialize(_handle,root,name,specification) compact=true inline=true functions=true + metacheck=true end if tname=="string" then if name=="return" then @@ -2022,7 +2027,7 @@ local function serialize(_handle,root,name,specification) handle("t={") end if root then - if getmetatable(root) then + if metacheck and getmetatable(root) then local dummy=root._w_h_a_t_e_v_e_r_ root._w_h_a_t_e_v_e_r_=nil end @@ -5926,7 +5931,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 28690, stripped down to: 18636 +-- original size: 29007, stripped down to: 18742 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -5940,7 +5945,7 @@ utilities.tables=utilities.tables or {} local tables=utilities.tables local format,gmatch,gsub,sub=string.format,string.gmatch,string.gsub,string.sub local concat,insert,remove,sort=table.concat,table.insert,table.remove,table.sort -local setmetatable,getmetatable,tonumber,tostring=setmetatable,getmetatable,tonumber,tostring +local setmetatable,getmetatable,tonumber,tostring,rawget=setmetatable,getmetatable,tonumber,tostring,rawget local type,next,rawset,tonumber,tostring,load,select=type,next,rawset,tonumber,tostring,load,select local lpegmatch,P,Cs,Cc=lpeg.match,lpeg.P,lpeg.Cs,lpeg.Cc local sortedkeys,sortedpairs=table.sortedkeys,table.sortedpairs @@ -6316,7 +6321,8 @@ function table.twowaymapper(t) if not t then t={} else - for i=0,#t do + local zero=rawget(t,0) + for i=zero or 1,#t do local ti=t[i] if ti then local i=tostring(i) @@ -6324,7 +6330,7 @@ function table.twowaymapper(t) t[ti]=i end end - t[""]=t[0] or "" + t[""]=zero or "" end setmetatable(t,selfmapper) return t @@ -6380,7 +6386,7 @@ local function serialize(root,name,specification) return nil end end - local haszero=t[0] + local haszero=rawget(t,0) if n==nt then local tt={} for i=1,nt do @@ -6442,7 +6448,7 @@ local function serialize(root,name,specification) local last=0 last=#root for k=1,last do - if root[k]==nil then + if rawget(root,k)==nil then last=k-1 break end @@ -6587,7 +6593,12 @@ local function serialize(root,name,specification) end table.serialize=serialize if setinspector then - setinspector("table",function(v) if type(v)=="table" then print(serialize(v,"table",{})) return true end end) + setinspector("table",function(v) + if type(v)=="table" then + print(serialize(v,"table",{ metacheck=false })) + return true + end + end) end @@ -18834,8 +18845,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 800533 --- stripped bytes : 290375 +-- original bytes : 801097 +-- stripped bytes : 290685 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 56f44bb5c..43b9a8d05 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -1389,7 +1389,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 37593, stripped down to: 22615 +-- original size: 37840, stripped down to: 22763 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1716,7 +1716,7 @@ function table.fromhash(t) end return hsh end -local noquotes,hexify,handle,compact,inline,functions +local noquotes,hexify,handle,compact,inline,functions,metacheck local reserved=table.tohash { 'and','break','do','else','elseif','end','false','for','function','if', 'in','local','nil','not','or','repeat','return','then','true','until','while', @@ -1786,7 +1786,7 @@ local function do_serialize(root,name,depth,level,indexed) if compact then last=#root for k=1,last do - if root[k]==nil then + if rawget(root,k)==nil then last=k-1 break end @@ -1983,6 +1983,7 @@ local function serialize(_handle,root,name,specification) functions=specification.functions compact=specification.compact inline=specification.inline and compact + metacheck=specification.metacheck if functions==nil then functions=true end @@ -1992,6 +1993,9 @@ local function serialize(_handle,root,name,specification) if inline==nil then inline=compact end + if metacheck==nil then + metacheck=true + end else noquotes=false hexify=false @@ -1999,6 +2003,7 @@ local function serialize(_handle,root,name,specification) compact=true inline=true functions=true + metacheck=true end if tname=="string" then if name=="return" then @@ -2022,7 +2027,7 @@ local function serialize(_handle,root,name,specification) handle("t={") end if root then - if getmetatable(root) then + if metacheck and getmetatable(root) then local dummy=root._w_h_a_t_e_v_e_r_ root._w_h_a_t_e_v_e_r_=nil end @@ -5926,7 +5931,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 28690, stripped down to: 18636 +-- original size: 29007, stripped down to: 18742 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -5940,7 +5945,7 @@ utilities.tables=utilities.tables or {} local tables=utilities.tables local format,gmatch,gsub,sub=string.format,string.gmatch,string.gsub,string.sub local concat,insert,remove,sort=table.concat,table.insert,table.remove,table.sort -local setmetatable,getmetatable,tonumber,tostring=setmetatable,getmetatable,tonumber,tostring +local setmetatable,getmetatable,tonumber,tostring,rawget=setmetatable,getmetatable,tonumber,tostring,rawget local type,next,rawset,tonumber,tostring,load,select=type,next,rawset,tonumber,tostring,load,select local lpegmatch,P,Cs,Cc=lpeg.match,lpeg.P,lpeg.Cs,lpeg.Cc local sortedkeys,sortedpairs=table.sortedkeys,table.sortedpairs @@ -6316,7 +6321,8 @@ function table.twowaymapper(t) if not t then t={} else - for i=0,#t do + local zero=rawget(t,0) + for i=zero or 1,#t do local ti=t[i] if ti then local i=tostring(i) @@ -6324,7 +6330,7 @@ function table.twowaymapper(t) t[ti]=i end end - t[""]=t[0] or "" + t[""]=zero or "" end setmetatable(t,selfmapper) return t @@ -6380,7 +6386,7 @@ local function serialize(root,name,specification) return nil end end - local haszero=t[0] + local haszero=rawget(t,0) if n==nt then local tt={} for i=1,nt do @@ -6442,7 +6448,7 @@ local function serialize(root,name,specification) local last=0 last=#root for k=1,last do - if root[k]==nil then + if rawget(root,k)==nil then last=k-1 break end @@ -6587,7 +6593,12 @@ local function serialize(root,name,specification) end table.serialize=serialize if setinspector then - setinspector("table",function(v) if type(v)=="table" then print(serialize(v,"table",{})) return true end end) + setinspector("table",function(v) + if type(v)=="table" then + print(serialize(v,"table",{ metacheck=false })) + return true + end + end) end @@ -18834,8 +18845,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 800533 --- stripped bytes : 290375 +-- original bytes : 801097 +-- stripped bytes : 290685 -- end library merge diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 797385b92..bdb7d6f74 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index a96d4ff24..3eae6e337 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2016.08.23 11:14} +\newcontextversion{2016.08.24 15:36} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index d88a97a6e..6c0256a1a 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2016.08.23 11:14} +\edef\contextversion{2016.08.24 15:36} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-osd.lua b/tex/context/base/mkiv/font-osd.lua index 8ddd9a272..6f715a11f 100644 --- a/tex/context/base/mkiv/font-osd.lua +++ b/tex/context/base/mkiv/font-osd.lua @@ -675,7 +675,7 @@ local function initializedevanagi(tfmdata) end end if kind == "pref" then - local sequence = dataset[3] -- was [5] +-- local sequence = dataset[3] -- was [5] local steps = sequence.steps local nofsteps = sequence.nofsteps for i=1,nofsteps do diff --git a/tex/context/base/mkiv/l-table.lua b/tex/context/base/mkiv/l-table.lua index d1e05928f..498f51833 100644 --- a/tex/context/base/mkiv/l-table.lua +++ b/tex/context/base/mkiv/l-table.lua @@ -478,7 +478,7 @@ function table.fromhash(t) return hsh end -local noquotes, hexify, handle, compact, inline, functions +local noquotes, hexify, handle, compact, inline, functions, metacheck local reserved = table.tohash { -- intercept a language inconvenience: no reserved words as key 'and', 'break', 'do', 'else', 'elseif', 'end', 'false', 'for', 'function', 'if', @@ -608,7 +608,8 @@ local function do_serialize(root,name,depth,level,indexed) if compact then last = #root for k=1,last do - if root[k] == nil then + -- if root[k] == nil then + if rawget(root,k) == nil then last = k - 1 break end @@ -817,6 +818,7 @@ local function serialize(_handle,root,name,specification) -- handle wins functions = specification.functions compact = specification.compact inline = specification.inline and compact + metacheck = specification.metacheck if functions == nil then functions = true end @@ -826,6 +828,9 @@ local function serialize(_handle,root,name,specification) -- handle wins if inline == nil then inline = compact end + if metacheck == nil then + metacheck = true + end else noquotes = false hexify = false @@ -833,6 +838,7 @@ local function serialize(_handle,root,name,specification) -- handle wins compact = true inline = true functions = true + metacheck = true end if tname == "string" then if name == "return" then @@ -857,8 +863,9 @@ local function serialize(_handle,root,name,specification) -- handle wins end if root then -- The dummy access will initialize a table that has a delayed initialization - -- using a metatable. (maybe explicitly test for metatable) - if getmetatable(root) then -- todo: make this an option, maybe even per subtable + -- using a metatable. (maybe explicitly test for metatable). This can crash on + -- metatables that check the index against a number. + if metacheck and getmetatable(root) then local dummy = root._w_h_a_t_e_v_e_r_ root._w_h_a_t_e_v_e_r_ = nil end diff --git a/tex/context/base/mkiv/page-mix.mkiv b/tex/context/base/mkiv/page-mix.mkiv index 83ce22058..5b3afc575 100644 --- a/tex/context/base/mkiv/page-mix.mkiv +++ b/tex/context/base/mkiv/page-mix.mkiv @@ -359,6 +359,16 @@ \unexpanded\def\startmixedcolumns {\dodoubleempty\page_mix_start_columns} +\def\page_mix_start_columns_checked#1#2% + {\edef\currentmixedcolumnsmethod{\mixedcolumnsparameter\c!method}% + \ifx\currentmixedcolumnsmethod\v!box + \singleexpandafter#1% + \else\ifinsidecolumns + \doubleexpandafter#2% + \else + \doubleexpandafter#1% + \fi\fi} + \unexpanded\def\page_mix_start_columns {\pushmacro\currentmixedcolumns \pushmacro\currentmixedcolumnsmethod @@ -370,15 +380,24 @@ \doubleexpandafter\page_mix_start_columns_c \fi\fi} -\def\page_mix_start_columns_a[#1][#2]% +\def\page_mix_start_columns_a[#1]% [#2]% {\edef\currentmixedcolumns{#1}% - \edef\currentmixedcolumnsmethod{\mixedcolumnsparameter\c!method}% - \mixedcolumnsparameter\c!before\relax + \page_mix_start_columns_checked + \page_mix_start_columns_a_yes + \page_mix_start_columns_a_nop} + +\def\page_mix_start_columns_a_yes[#1]% + {\mixedcolumnsparameter\c!before\relax \begincsname\??mixedcolumnsbefore\currentmixedcolumnsmethod\endcsname\relax \begingroup - \setupcurrentmixedcolumns[#2]% + \setupcurrentmixedcolumns[#1]% \page_mix_initialize_columns - \begincsname\??mixedcolumnsstart\currentmixedcolumnsmethod\endcsname} + \begincsname\??mixedcolumnsstart\currentmixedcolumnsmethod\endcsname + \let\stopmixedcolumns\page_mix_columns_stop_yes} + +\def\page_mix_start_columns_a_nop[#1]% + {\begingroup + \let\stopmixedcolumns\page_mix_columns_stop_nop} \def\page_mix_start_columns_b[#1][#2]% {\doifelseassignment{#1}% @@ -386,44 +405,65 @@ \page_mix_error_b} {\edef\currentmixedcolumns{#1}% \firstargumentfalse}% - \edef\currentmixedcolumnsmethod{\mixedcolumnsparameter\c!method}% - \mixedcolumnsparameter\c!before\relax % so, it doesn't listen to local settings ! + \page_mix_start_columns_checked + \page_mix_start_columns_b_yes + \page_mix_start_columns_b_nop + [#1]} + +\def\page_mix_start_columns_b_yes[#1]% + {\mixedcolumnsparameter\c!before\relax % so, it doesn't listen to local settings ! \begincsname\??mixedcolumnsbefore\currentmixedcolumnsmethod\endcsname\relax \begingroup \iffirstargument \setupcurrentmixedcolumns[#1]% \fi \page_mix_initialize_columns - \begincsname\??mixedcolumnsstart\currentmixedcolumnsmethod\endcsname} % no \relax + \begincsname\??mixedcolumnsstart\currentmixedcolumnsmethod\endcsname % no \relax + \let\stopmixedcolumns\page_mix_columns_stop_yes} + +\def\page_mix_start_columns_b_nop[#1]% + {\begingroup + \let\stopmixedcolumns\page_mix_columns_stop_nop} \def\page_mix_error_b {\writestatus\m!columns{best use an instance of mixed columns}} \def\page_mix_start_columns_c[#1][#2]% {\let\currentmixedcolumns\empty - \edef\currentmixedcolumnsmethod{\mixedcolumnsparameter\c!method}% - \mixedcolumnsparameter\c!before\relax + \page_mix_start_columns_checked + \page_mix_start_columns_c_yes + \page_mix_start_columns_c_nop} + +\def\page_mix_start_columns_c_yes + {\mixedcolumnsparameter\c!before\relax \begincsname\??mixedcolumnsbefore\currentmixedcolumnsmethod\endcsname\relax \begingroup \page_mix_initialize_columns \begincsname\??mixedcolumnsstart\currentmixedcolumnsmethod\endcsname} +\def\page_mix_start_columns_c_nop + {\begingroup + \let\stopmixedcolumns\page_mix_columns_stop_nop} + \unexpanded\def\page_mix_fast_columns_start#1% {\pushmacro\currentmixedcolumns \pushmacro\currentmixedcolumnsmethod \edef\currentmixedcolumns{#1}% \edef\currentmixedcolumnsmethod{\mixedcolumnsparameter\c!method}% - \mixedcolumnsparameter\c!before\relax % so, it doesn't list to local settings ! + \mixedcolumnsparameter\c!before\relax % so, it doesn't listen to local settings ! \begincsname\??mixedcolumnsbefore\currentmixedcolumnsmethod\endcsname\relax \begingroup \page_mix_initialize_columns - \begincsname\??mixedcolumnsstart\currentmixedcolumnsmethod\endcsname} % no \relax + \begincsname\??mixedcolumnsstart\currentmixedcolumnsmethod\endcsname % no \relax + \let\page_mix_fast_columns_stop\page_mix_columns_stop_yes} %D When we stop, we switch over to the balancing routine. After we're done we %D make sure to set the sizes are set, a somewhat redundant action when we %D already have flushed but better be safe. -\unexpanded\def\stopmixedcolumns +\let\page_mix_fast_columns_stop\relax + +\unexpanded\def\page_mix_columns_stop_yes {\begincsname\??mixedcolumnsstop \currentmixedcolumnsmethod\endcsname % no \relax \endgroup \begincsname\??mixedcolumnsafter\currentmixedcolumnsmethod\endcsname\relax @@ -431,7 +471,12 @@ \popmacro\currentmixedcolumnsmethod \popmacro\currentmixedcolumns} -% \unexpanded\def\stopmixedcolumns +\unexpanded\def\page_mix_columns_stop_nop + {\endgroup + \popmacro\currentmixedcolumnsmethod + \popmacro\currentmixedcolumns} + +% \unexpanded\def\page_mix_columns_stop_yes % {\begincsname\??mixedcolumnsstop \currentmixedcolumnsmethod\endcsname % no \relax % \endgroup % \begincsname\??mixedcolumnsafter\currentmixedcolumnsmethod\endcsname\relax @@ -446,14 +491,13 @@ % \fi % } -\let\page_mix_fast_columns_stop\stopmixedcolumns - %D This is how the fast one is used: \unexpanded\def\strc_itemgroups_start_columns {\page_mix_fast_columns_start\s!itemgroupcolumns} -\let\strc_itemgroups_stop_columns\page_mix_fast_columns_stop +\unexpanded\def\strc_itemgroups_stop_columns + {\page_mix_fast_columns_stop} % set by start \setupmixedcolumns [\s!itemgroupcolumns] @@ -789,25 +833,6 @@ \letvalue{\??mixedcolumnsbefore\s!box}\donothing \letvalue{\??mixedcolumnsafter \s!box}\donothing -% \setvalue{\??mixedcolumnsstart\s!box}% -% {\edef\p_page_mix_strut{\mixedcolumnsparameter\c!strut}% -% \setbox\b_page_mix_collected\vbox\bgroup -% \let\currentoutputroutine\s!mixedcolumn % makes \column work -% \forgetall -% \page_mix_command_set_hsize -% \ifx\p_page_mix_strut\v!yes -% \begstrut -% \ignorespaces -% \fi} -% -% \setvalue{\??mixedcolumnsstop\s!box}% -% {\ifx\p_page_mix_strut\v!yes -% \removeunwantedspaces -% \endstrut -% \fi -% \egroup -% \page_mix_box_balance} - \setvalue{\??mixedcolumnsstart\s!box}% {\edef\p_page_mix_strut{\mixedcolumnsparameter\c!strut}% \setbox\b_page_mix_collected\vbox \bgroup diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex ae89dcfeb..8819b504d 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex f85658e66..c1e4be45c 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/tabl-xtb.lua b/tex/context/base/mkiv/tabl-xtb.lua index 674a0bf5a..afcdc5855 100644 --- a/tex/context/base/mkiv/tabl-xtb.lua +++ b/tex/context/base/mkiv/tabl-xtb.lua @@ -520,6 +520,7 @@ function xtables.reflow_width() local nofrows = data.nofrows local nofcolumns = data.nofcolumns local rows = data.rows +-- inspect(rows) for r=1,nofrows do local row = rows[r] for c=1,nofcolumns do @@ -551,6 +552,7 @@ function xtables.reflow_width() showwidths("stage 1",widths,autowidths) end local noffrozen = 0 +-- here we can also check spans -- inspect(data.fixedcspans) if options[v_max] then for c=1,nofcolumns do diff --git a/tex/context/base/mkiv/util-tab.lua b/tex/context/base/mkiv/util-tab.lua index d50205892..b8b9091b0 100644 --- a/tex/context/base/mkiv/util-tab.lua +++ b/tex/context/base/mkiv/util-tab.lua @@ -12,7 +12,7 @@ local tables = utilities.tables local format, gmatch, gsub, sub = string.format, string.gmatch, string.gsub, string.sub local concat, insert, remove, sort = table.concat, table.insert, table.remove, table.sort -local setmetatable, getmetatable, tonumber, tostring = setmetatable, getmetatable, tonumber, tostring +local setmetatable, getmetatable, tonumber, tostring, rawget = setmetatable, getmetatable, tonumber, tostring, rawget local type, next, rawset, tonumber, tostring, load, select = type, next, rawset, tonumber, tostring, load, select local lpegmatch, P, Cs, Cc = lpeg.match, lpeg.P, lpeg.Cs, lpeg.Cc local sortedkeys, sortedpairs = table.sortedkeys, table.sortedpairs @@ -489,7 +489,8 @@ function table.twowaymapper(t) if not t then t = { } else - for i=0,#t do + local zero = rawget(t,0) + for i=zero or 1,#t do local ti = t[i] -- t[1] = "one" if ti then local i = tostring(i) @@ -497,7 +498,7 @@ function table.twowaymapper(t) t[ti] = i -- t["one"] = "1" end end - t[""] = t[0] or "" + t[""] = zero or "" end -- setmetatableindex(t,"key") setmetatable(t,selfmapper) @@ -616,7 +617,8 @@ local function serialize(root,name,specification) return nil end end - local haszero = t[0] + -- local haszero = t[0] + local haszero = rawget(t,0) -- don't trigger meta if n == nt then local tt = { } for i=1,nt do @@ -680,7 +682,8 @@ local function serialize(root,name,specification) local last = 0 last = #root for k=1,last do - if root[k] == nil then + if rawget(root,k) == nil then + -- if root[k] == nil then last = k - 1 break end @@ -810,7 +813,8 @@ local function serialize(root,name,specification) if root then -- The dummy access will initialize a table that has a delayed initialization - -- using a metatable. (maybe explicitly test for metatable) + -- using a metatable. (maybe explicitly test for metatable). This can crash on + -- metatables that check the index against a number. if getmetatable(root) then -- todo: make this an option, maybe even per subtable local dummy = root._w_h_a_t_e_v_e_r_ -- needed root._w_h_a_t_e_v_e_r_ = nil @@ -833,5 +837,10 @@ end table.serialize = serialize if setinspector then - setinspector("table",function(v) if type(v) == "table" then print(serialize(v,"table",{})) return true end end) + setinspector("table",function(v) + if type(v) == "table" then + print(serialize(v,"table",{ metacheck = false })) + return true + end + end) end diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex 2a0ec1548..a7d0dfa91 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex cf81b5ce8..2c37bae5a 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 7b594b03b..62c427592 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 08/23/16 11:14:05 +-- merge date : 08/24/16 15:36:43 do -- begin closure to overcome local limits and interference @@ -1352,7 +1352,7 @@ function table.fromhash(t) end return hsh end -local noquotes,hexify,handle,compact,inline,functions +local noquotes,hexify,handle,compact,inline,functions,metacheck local reserved=table.tohash { 'and','break','do','else','elseif','end','false','for','function','if', 'in','local','nil','not','or','repeat','return','then','true','until','while', @@ -1422,7 +1422,7 @@ local function do_serialize(root,name,depth,level,indexed) if compact then last=#root for k=1,last do - if root[k]==nil then + if rawget(root,k)==nil then last=k-1 break end @@ -1619,6 +1619,7 @@ local function serialize(_handle,root,name,specification) functions=specification.functions compact=specification.compact inline=specification.inline and compact + metacheck=specification.metacheck if functions==nil then functions=true end @@ -1628,6 +1629,9 @@ local function serialize(_handle,root,name,specification) if inline==nil then inline=compact end + if metacheck==nil then + metacheck=true + end else noquotes=false hexify=false @@ -1635,6 +1639,7 @@ local function serialize(_handle,root,name,specification) compact=true inline=true functions=true + metacheck=true end if tname=="string" then if name=="return" then @@ -1658,7 +1663,7 @@ local function serialize(_handle,root,name,specification) handle("t={") end if root then - if getmetatable(root) then + if metacheck and getmetatable(root) then local dummy=root._w_h_a_t_e_v_e_r_ root._w_h_a_t_e_v_e_r_=nil end @@ -21664,7 +21669,6 @@ local function initializedevanagi(tfmdata) end end if kind=="pref" then - local sequence=dataset[3] local steps=sequence.steps local nofsteps=sequence.nofsteps for i=1,nofsteps do |