From 8b7c04b3f228340eddb1cd1a82f95af652812536 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 15 May 2015 23:23:10 +0000 Subject: context from current for tl15 git-svn-id: svn://tug.org/texlive/trunk@37419 c570f23f-e606-0410-a88d-b1316a301751 --- Master/bin/win32/mtxrun.lua | 244 +++++++++--------- .../documents/general/manuals/epub-mkiv-demo.epub | Bin 10201 -> 10194 bytes .../documents/general/manuals/epub-mkiv-demo.pdf | Bin 19190 -> 19204 bytes .../documents/general/manuals/epub-mkiv.pdf | Bin 98657 -> 98659 bytes .../context/documents/general/manuals/mreadme.pdf | Bin 40702 -> 40702 bytes .../documents/general/manuals/swiglib-mkiv.pdf | Bin 169013 -> 169009 bytes .../context/documents/general/manuals/tiptrick.pdf | Bin 47188 -> 47182 bytes .../documents/general/manuals/tools-mkiv.pdf | Bin 374427 -> 374423 bytes .../documents/general/manuals/units-mkiv.pdf | Bin 163683 -> 163696 bytes .../documents/general/manuals/workflows-mkiv.pdf | Bin 94236 -> 94311 bytes .../documents/general/manuals/xtables-mkiv.pdf | Bin 136327 -> 136336 bytes Master/texmf-dist/doc/man/man1/context.man1.pdf | Bin 7742 -> 7742 bytes Master/texmf-dist/doc/man/man1/luatools.man1.pdf | Bin 5105 -> 5105 bytes Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf | Bin 3672 -> 3672 bytes Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf | Bin 5124 -> 5124 bytes Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf | Bin 3694 -> 3694 bytes Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf | 16 +- Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf | Bin 3554 -> 3554 bytes Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf | Bin 3442 -> 3442 bytes .../texmf-dist/doc/man/man1/mtx-context.man1.pdf | Bin 7742 -> 7742 bytes Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf | Bin 3826 -> 3826 bytes Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf | Bin 3959 -> 3959 bytes Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf | Bin 3668 -> 3668 bytes Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf | Bin 4213 -> 4213 bytes Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf | Bin 3545 -> 3545 bytes .../texmf-dist/doc/man/man1/mtx-interface.man1.pdf | Bin 4105 -> 4105 bytes .../texmf-dist/doc/man/man1/mtx-metapost.man1.pdf | 16 +- .../texmf-dist/doc/man/man1/mtx-metatex.man1.pdf | Bin 3630 -> 3630 bytes .../texmf-dist/doc/man/man1/mtx-modules.man1.pdf | Bin 3760 -> 3760 bytes .../texmf-dist/doc/man/man1/mtx-package.man1.pdf | Bin 3568 -> 3568 bytes .../texmf-dist/doc/man/man1/mtx-patterns.man1.pdf | Bin 4137 -> 4137 bytes Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf | Bin 3695 -> 3695 bytes Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf | Bin 3709 -> 3709 bytes .../texmf-dist/doc/man/man1/mtx-profile.man1.pdf | 16 +- Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf | Bin 3638 -> 3638 bytes Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf | Bin 3752 -> 3752 bytes Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf | 16 +- .../texmf-dist/doc/man/man1/mtx-texworks.man1.pdf | Bin 3557 -> 3557 bytes Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf | Bin 3679 -> 3679 bytes Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf | Bin 3995 -> 3995 bytes Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf | Bin 3597 -> 3597 bytes Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf | Bin 5029 -> 5029 bytes Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf | Bin 3867 -> 3867 bytes .../texmf-dist/doc/man/man1/mtx-youless.man1.pdf | Bin 3858 -> 3858 bytes Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf | Bin 7216 -> 7216 bytes Master/texmf-dist/doc/man/man1/texexec.man1.pdf | Bin 4713 -> 4713 bytes Master/texmf-dist/doc/man/man1/texmfstart.man1.pdf | Bin 7216 -> 7216 bytes Master/texmf-dist/scripts/context/lua/mtxrun.lua | 244 +++++++++--------- .../scripts/context/stubs/mswin/mtxrun.lua | 244 +++++++++--------- .../texmf-dist/scripts/context/stubs/unix/mtxrun | 244 +++++++++--------- .../scripts/context/stubs/win64/mtxrun.lua | 244 +++++++++--------- Master/texmf-dist/tex/context/base/cont-new.mkiv | 2 +- .../tex/context/base/context-version.pdf | Bin 4176 -> 4178 bytes Master/texmf-dist/tex/context/base/context.mkiv | 4 +- Master/texmf-dist/tex/context/base/core-con.lua | 2 +- Master/texmf-dist/tex/context/base/core-sys.mkiv | 16 +- Master/texmf-dist/tex/context/base/data-tmp.lua | 13 +- Master/texmf-dist/tex/context/base/font-otn.lua | 24 +- Master/texmf-dist/tex/context/base/font-otp.lua | 2 + Master/texmf-dist/tex/context/base/font-sty.mkvi | 2 +- Master/texmf-dist/tex/context/base/l-table.lua | 280 +++++++++++++-------- Master/texmf-dist/tex/context/base/math-fen.mkiv | 4 + Master/texmf-dist/tex/context/base/math-ini.mkiv | 7 - .../texmf-dist/tex/context/base/publ-imp-apa.mkvi | 18 +- .../texmf-dist/tex/context/base/publ-imp-aps.mkvi | 16 +- .../tex/context/base/publ-imp-default.mkvi | 8 + .../texmf-dist/tex/context/base/publ-imp-list.mkvi | 22 +- Master/texmf-dist/tex/context/base/publ-ini.lua | 11 +- Master/texmf-dist/tex/context/base/publ-ini.mkiv | 12 +- Master/texmf-dist/tex/context/base/publ-reg.lua | 52 +++- Master/texmf-dist/tex/context/base/publ-tra.lua | 24 ++ Master/texmf-dist/tex/context/base/publ-tra.mkiv | 4 + .../texmf-dist/tex/context/base/status-files.pdf | Bin 24457 -> 24472 bytes Master/texmf-dist/tex/context/base/status-lua.pdf | Bin 251171 -> 251187 bytes Master/texmf-dist/tex/context/base/typo-itc.lua | 11 +- Master/texmf-dist/tex/context/base/typo-sus.lua | 7 + Master/texmf-dist/tex/context/base/util-prs.lua | 46 ++-- Master/texmf-dist/tex/context/base/util-tab.lua | 60 +++-- Master/texmf-dist/tex/context/base/x-asciimath.lua | 12 +- .../texmf-dist/tex/context/base/x-asciimath.mkiv | 16 +- .../generic/context/luatex/luatex-fonts-merged.lua | 169 ++++++------- .../generic/context/luatex/luatex-fonts-otn.lua | 20 +- Master/tlpkg/bin/tl-update-bindir | 3 +- Master/tlpkg/bin/tlpkginfo | 2 +- 84 files changed, 1183 insertions(+), 970 deletions(-) (limited to 'Master') diff --git a/Master/bin/win32/mtxrun.lua b/Master/bin/win32/mtxrun.lua index 6afe0fab5b0..edfeba8ddc8 100755 --- a/Master/bin/win32/mtxrun.lua +++ b/Master/bin/win32/mtxrun.lua @@ -1372,7 +1372,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 33830, stripped down to: 21894 +-- original size: 35724, stripped down to: 21525 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1405,7 +1405,7 @@ end function table.keys(t) if t then local keys,k={},0 - for key,_ in next,t do + for key in next,t do k=k+1 keys[k]=key end @@ -1416,32 +1416,51 @@ function table.keys(t) end local function compare(a,b) local ta=type(a) - local tb=type(b) - if ta==tb and ta=="number" then - return a1 then + sort(srt) + end return srt else return {} @@ -1469,13 +1490,15 @@ end local function sortedindexonly(tab) if tab then local srt,s={},0 - for key,_ in next,tab do + for key in next,tab do if type(key)=="number" then s=s+1 srt[s]=key end end - sort(srt) + if s>1 then + sort(srt) + end return srt else return {} @@ -1484,13 +1507,15 @@ end local function sortedhashkeys(tab,cmp) if tab then local srt,s={},0 - for key,_ in next,tab do + for key in next,tab do if key then s=s+1 srt[s]=key end end - sort(srt,cmp) + if s>1 then + sort(srt,cmp) + end return srt else return {} @@ -1499,7 +1524,7 @@ end function table.allkeys(t) local keys={} for k,v in next,t do - for k,v in next,v do + for k in next,v do keys[k]=true end end @@ -1518,19 +1543,21 @@ local function sortedhash(t,cmp) else s=sortedkeys(t) end - local n=0 local m=#s - local function kv() - if n0 then + local n=0 + return function() + if n0 then + local nt=#t + if nt>0 then local n=0 for _,v in next,t do n=n+1 end - if n==#t then - local tt,nt={},0 - for i=1,#t do + if n==nt then + local tt={} + for i=1,nt do local v=t[i] local tv=type(v) if tv=="number" then - nt=nt+1 if hexify then - tt[nt]=format("0x%X",v) + tt[i]=format("0x%X",v) else - tt[nt]=tostring(v) + tt[i]=tostring(v) end elseif tv=="string" then - nt=nt+1 - tt[nt]=format("%q",v) + tt[i]=format("%q",v) elseif tv=="boolean" then - nt=nt+1 - tt[nt]=v and "true" or "false" + tt[i]=v and "true" or "false" else - tt=nil - break + return nil end end return tt @@ -1758,7 +1782,8 @@ local function do_serialize(root,name,depth,level,indexed) for i=1,#sk do local k=sk[i] local v=root[k] - local tv,tk=type(v),type(k) + local tv=type(v) + local tk=type(k) if compact and first and tk=="number" and k>=first and k<=last then if tv=="number" then if hexify then @@ -1767,11 +1792,7 @@ local function do_serialize(root,name,depth,level,indexed) handle(format("%s %s,",depth,v)) end elseif tv=="string" then - if reduce and tonumber(v) then - handle(format("%s %s,",depth,v)) - else - handle(format("%s %q,",depth,v)) - end + handle(format("%s %q,",depth,v)) elseif tv=="table" then if next(v)==nil then handle(format("%s {},",depth)) @@ -1827,34 +1848,18 @@ local function do_serialize(root,name,depth,level,indexed) end end elseif tv=="string" then - if reduce and tonumber(v) then - if tk=="number" then - if hexify then - handle(format("%s [0x%X]=%s,",depth,k,v)) - else - handle(format("%s [%s]=%s,",depth,k,v)) - end - elseif tk=="boolean" then - handle(format("%s [%s]=%s,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%s,",depth,k,v)) + if tk=="number" then + if hexify then + handle(format("%s [0x%X]=%q,",depth,k,v)) else - handle(format("%s [%q]=%s,",depth,k,v)) + handle(format("%s [%s]=%q,",depth,k,v)) end + elseif tk=="boolean" then + handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) + elseif noquotes and not reserved[k] and lpegmatch(propername,k) then + handle(format("%s %s=%q,",depth,k,v)) else - if tk=="number" then - if hexify then - handle(format("%s [0x%X]=%q,",depth,k,v)) - else - handle(format("%s [%s]=%q,",depth,k,v)) - end - elseif tk=="boolean" then - handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%q,",depth,k,v)) - else - handle(format("%s [%q]=%q,",depth,k,v)) - end + handle(format("%s [%q]=%q,",depth,k,v)) end elseif tv=="table" then if next(v)==nil then @@ -1951,7 +1956,6 @@ local function serialize(_handle,root,name,specification) noquotes=specification.noquotes hexify=specification.hexify handle=_handle or specification.handle or print - reduce=specification.reduce or false functions=specification.functions compact=specification.compact inline=specification.inline and compact @@ -1968,7 +1972,6 @@ local function serialize(_handle,root,name,specification) noquotes=false hexify=false handle=_handle or print - reduce=false compact=true inline=true functions=true @@ -5882,7 +5885,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 24267, stripped down to: 16260 +-- original size: 25338, stripped down to: 16247 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -5895,7 +5898,7 @@ utilities=utilities or {} 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=table.concat,table.insert,table.remove +local concat,insert,remove,sort=table.concat,table.insert,table.remove,table.sort local setmetatable,getmetatable,tonumber,tostring=setmetatable,getmetatable,tonumber,tostring 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 @@ -6325,7 +6328,8 @@ function table.serialize(root,name,specification) local t local n=1 local function simple_table(t) - if #t>0 then + local nt=#t + if nt>0 then local n=0 for _,v in next,t do n=n+1 @@ -6333,19 +6337,17 @@ function table.serialize(root,name,specification) return nil end end - if n==#t then + if n==nt then local tt={} - local nt=0 - for i=1,#t do + for i=1,nt do local v=t[i] local tv=type(v) - nt=nt+1 if tv=="number" then - tt[nt]=v + tt[i]=v elseif tv=="string" then - tt[nt]=format("%q",v) + tt[i]=format("%q",v) elseif tv=="boolean" then - tt[nt]=v and "true" or "false" + tt[i]=v and "true" or "false" else return nil end @@ -6393,7 +6395,7 @@ function table.serialize(root,name,specification) local v=root[k] local tv=type(v) local tk=type(k) - if first and tk=="number" and k>=first and k<=last then + if first and tk=="number" and k<=last and k>=first then if tv=="number" then n=n+1 t[n]=f_val_num(depth,v) elseif tv=="string" then @@ -6431,11 +6433,11 @@ function table.serialize(root,name,specification) elseif tv=="table" then if next(v)==nil then if tk=="number" then - n=n+1 t[n]=f_key_num_value_not(depth,k,v) + n=n+1 t[n]=f_key_num_value_not(depth,k) elseif tk=="string" then - n=n+1 t[n]=f_key_str_value_not(depth,k,v) + n=n+1 t[n]=f_key_str_value_not(depth,k) elseif tk=="boolean" then - n=n+1 t[n]=f_key_boo_value_not(depth,k,v) + n=n+1 t[n]=f_key_boo_value_not(depth,k) end else local st=simple_table(v) @@ -6650,7 +6652,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-prs"] = package.loaded["util-prs"] or true --- original size: 21751, stripped down to: 15108 +-- original size: 21780, stripped down to: 15121 if not modules then modules={} end modules ['util-prs']={ version=1.001, @@ -6672,6 +6674,8 @@ local patterns=parsers.patterns or {} parsers.patterns=patterns local setmetatableindex=table.setmetatableindex local sortedhash=table.sortedhash +local sortedkeys=table.sortedkeys +local tohash=table.tohash local digit=R("09") local space=P(' ') local equal=P("=") @@ -6721,9 +6725,7 @@ patterns.settings_to_hash_a=pattern_a_s patterns.settings_to_hash_b=pattern_b_s patterns.settings_to_hash_c=pattern_c_s function parsers.make_settings_to_hash_pattern(set,how) - if type(str)=="table" then - return set - elseif how=="strict" then + if how=="strict" then return (pattern_c/set)^1 elseif how=="tolerant" then return (pattern_b/set)^1 @@ -6732,7 +6734,9 @@ function parsers.make_settings_to_hash_pattern(set,how) end end function parsers.settings_to_hash(str,existing) - if type(str)=="table" then + if not str or str=="" then + return {} + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6741,16 +6745,16 @@ function parsers.settings_to_hash(str,existing) else return str end - elseif str and str~="" then + else hash=existing or {} lpegmatch(pattern_a_s,str) return hash - else - return {} end end function parsers.settings_to_hash_tolerant(str,existing) - if type(str)=="table" then + if not str or str=="" then + return {} + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6759,16 +6763,16 @@ function parsers.settings_to_hash_tolerant(str,existing) else return str end - elseif str and str~="" then + else hash=existing or {} lpegmatch(pattern_b_s,str) return hash - else - return {} end end function parsers.settings_to_hash_strict(str,existing) - if type(str)=="table" then + if not str or str=="" then + return nil + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6781,8 +6785,6 @@ function parsers.settings_to_hash_strict(str,existing) hash=existing or {} lpegmatch(pattern_c_s,str) return next(hash) and hash - else - return nil end end local separator=comma*space^0 @@ -6790,10 +6792,10 @@ local value=P(lbrace*C((nobrace+nestedbraces)^0)*rbrace)+C((nestedbraces+(1-comm local pattern=spaces*Ct(value*(separator*value)^0) patterns.settings_to_array=pattern function parsers.settings_to_array(str,strict) - if type(str)=="table" then - return str - elseif not str or str=="" then + if not str or str=="" then return {} + elseif type(str)=="table" then + return str elseif strict then if find(str,"{",1,true) then return lpegmatch(pattern,str) @@ -6854,8 +6856,8 @@ function parsers.add_settings_to_array(t,str) end function parsers.hash_to_string(h,separator,yes,no,strict,omit) if h then - local t,tn,s={},0,table.sortedkeys(h) - omit=omit and table.tohash(omit) + local t,tn,s={},0,sortedkeys(h) + omit=omit and tohash(omit) for i=1,#s do local key=s[i] if not omit or not omit[key] then @@ -7001,7 +7003,7 @@ function parsers.keq_to_hash(str) end local defaultspecification={ separator=",",quote='"' } function parsers.csvsplitter(specification) - specification=specification and table.setmetatableindex(specification,defaultspecification) or defaultspecification + specification=specification and setmetatableindex(specification,defaultspecification) or defaultspecification local separator=specification.separator local quotechar=specification.quote local separator=S(separator~="" and separator or ",") @@ -7025,7 +7027,7 @@ function parsers.csvsplitter(specification) end end function parsers.rfc4180splitter(specification) - specification=specification and table.setmetatableindex(specification,defaultspecification) or defaultspecification + specification=specification and setmetatableindex(specification,defaultspecification) or defaultspecification local separator=specification.separator local quotechar=P(specification.quote) local dquotechar=quotechar*quotechar @@ -7084,9 +7086,9 @@ function parsers.unittoxml(str) return lpegmatch(pattern,str) end local cache={} -local spaces=lpeg.patterns.space^0 +local spaces=lpegpatterns.space^0 local dummy=function() end -table.setmetatableindex(cache,function(t,k) +setmetatableindex(cache,function(t,k) local separator=P(k) local value=(1-separator)^0 local pattern=spaces*C(value)*separator^0*Cp() @@ -14060,7 +14062,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tmp"] = package.loaded["data-tmp"] or true --- original size: 15681, stripped down to: 11761 +-- original size: 15618, stripped down to: 11629 if not modules then modules={} end modules ['data-tmp']={ version=1.100, @@ -14070,7 +14072,7 @@ if not modules then modules={} end modules ['data-tmp']={ license="see context related readme files" } local format,lower,gsub,concat=string.format,string.lower,string.gsub,table.concat -local concat,serialize,serializetofile=table.concat,table.serialize,table.tofile +local concat=table.concat local mkdirs,isdir,isfile=dir.mkdirs,lfs.isdir,lfs.isfile local addsuffix,is_writable,is_readable=file.addsuffix,file.is_writable,file.is_readable local formatters=string.formatters @@ -14339,15 +14341,11 @@ end local saveoptions={ compact=true } function caches.savedata(filepath,filename,data,raw) local tmaname,tmcname=caches.setluanames(filepath,filename) - local reduce,simplify=true,true - if raw then - reduce,simplify=false,false - end data.cache_uuid=os.uuid() if caches.direct then - file.savedata(tmaname,serialize(data,true,saveoptions)) + file.savedata(tmaname,table.serialize(data,true,saveoptions)) else - serializetofile(tmaname,data,true,saveoptions) + table.tofile(tmaname,data,true,saveoptions) end utilities.lua.compile(tmaname,tmcname) end @@ -14412,7 +14410,7 @@ function caches.savecontent(cachename,dataname,content,filename) content=content, uuid=os.uuid(), } - local ok=io.savedata(luaname,serialize(data,true)) + local ok=io.savedata(luaname,table.serialize(data,true)) if ok then if trace_locating then report_resolvers("category %a, cachename %a saved in %a",dataname,cachename,luaname) @@ -17938,8 +17936,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-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 : 742687 --- stripped bytes : 265759 +-- original bytes : 745618 +-- stripped bytes : 269191 -- end library merge diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/epub-mkiv-demo.epub b/Master/texmf-dist/doc/context/documents/general/manuals/epub-mkiv-demo.epub index 331255cbe3e..2fc6200ff25 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/epub-mkiv-demo.epub and b/Master/texmf-dist/doc/context/documents/general/manuals/epub-mkiv-demo.epub differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/epub-mkiv-demo.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/epub-mkiv-demo.pdf index 34c09693a20..9a390cb92fe 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/epub-mkiv-demo.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/epub-mkiv-demo.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/epub-mkiv.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/epub-mkiv.pdf index 205b506ceaf..1045056cdaa 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/epub-mkiv.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/epub-mkiv.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/mreadme.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/mreadme.pdf index 3cc61819d21..d27bbaedfd8 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/mreadme.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/mreadme.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/swiglib-mkiv.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/swiglib-mkiv.pdf index f5ddee46c25..3e146f9d1a3 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/swiglib-mkiv.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/swiglib-mkiv.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/tiptrick.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/tiptrick.pdf index 5ae09b9d328..85bfda8938b 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/tiptrick.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/tiptrick.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/tools-mkiv.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/tools-mkiv.pdf index 5c690303cec..563b35aac0d 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/tools-mkiv.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/tools-mkiv.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/units-mkiv.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/units-mkiv.pdf index c7b127dd274..f931d6d6b0a 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/units-mkiv.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/units-mkiv.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/workflows-mkiv.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/workflows-mkiv.pdf index 7876226f2c8..3a2caaede4c 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/workflows-mkiv.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/workflows-mkiv.pdf differ diff --git a/Master/texmf-dist/doc/context/documents/general/manuals/xtables-mkiv.pdf b/Master/texmf-dist/doc/context/documents/general/manuals/xtables-mkiv.pdf index cd59d579a77..d3550c0ee66 100644 Binary files a/Master/texmf-dist/doc/context/documents/general/manuals/xtables-mkiv.pdf and b/Master/texmf-dist/doc/context/documents/general/manuals/xtables-mkiv.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/context.man1.pdf b/Master/texmf-dist/doc/man/man1/context.man1.pdf index 40b8ea5014d..08e1c494c61 100644 Binary files a/Master/texmf-dist/doc/man/man1/context.man1.pdf and b/Master/texmf-dist/doc/man/man1/context.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/luatools.man1.pdf b/Master/texmf-dist/doc/man/man1/luatools.man1.pdf index 421d9b20e29..f04585a53e0 100644 Binary files a/Master/texmf-dist/doc/man/man1/luatools.man1.pdf and b/Master/texmf-dist/doc/man/man1/luatools.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf index 2a9f2cd3d2b..289ea480511 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf index e337b90e11e..6e7e634509a 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf index c3a15eab422..02c73b66d90 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf index ad54a38d3dd..9ceed3880a2 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf +++ b/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf @@ -63,12 +63,12 @@ endobj - -2015-05-15T00:52:26+02:00 -2015-05-15T00:52:26+02:00 + +2015-05-16T01:22:30+02:00 +2015-05-16T01:22:30+02:00 groff version 1.22.3 - -Untitled + +Untitled @@ -78,8 +78,8 @@ endstream endobj 2 0 obj <>endobj xref 0 14 @@ -99,7 +99,7 @@ xref 0000001555 00000 n trailer << /Size 14 /Root 1 0 R /Info 2 0 R -/ID [] +/ID [<3841DEF85F289039A2C09F52A23F5B12><3841DEF85F289039A2C09F52A23F5B12>] >> startxref 3132 diff --git a/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf index 3662b716f1e..5d5b0ad7f4d 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf index 4bdab444b68..8398e339ef7 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf index 9a518fd8355..ee2921c0ea8 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf index 04880d6592e..4cc0699b9c0 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf index 3072f6ff840..969dbcd0fc4 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf index 131cf0e454f..6f70ac0344f 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf index 3e45fb06f31..1d5c48a0231 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf index 00fe43dec30..eb7df5af9b2 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf index af9dd432776..5bb2be311bd 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf index 72572c5a012..b7879674923 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf +++ b/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf @@ -66,12 +66,12 @@ endobj - -2015-05-15T00:52:24+02:00 -2015-05-15T00:52:24+02:00 + +2015-05-16T01:22:27+02:00 +2015-05-16T01:22:27+02:00 groff version 1.22.3 - -Untitled + +Untitled @@ -81,8 +81,8 @@ endstream endobj 2 0 obj <>endobj xref 0 15 @@ -103,7 +103,7 @@ xref 0000001681 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R -/ID [] +/ID [<348DD4B61DCB88139014A1B2452E97E8><348DD4B61DCB88139014A1B2452E97E8>] >> startxref 3258 diff --git a/Master/texmf-dist/doc/man/man1/mtx-metatex.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-metatex.man1.pdf index 0efac3b3b0c..6cbf6edcb2a 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-metatex.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-metatex.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf index d6980a0afd9..24a34b6506b 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf index 0e5c3b752f4..09f7af0d042 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdf index 7b1e8b46810..ffbe53b7fca 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf index eeb925f92df..3adac541ee4 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf index 23d45326130..4d6dd3a036c 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf index 943b2267799..c73af7e7fa4 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf +++ b/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf @@ -72,12 +72,12 @@ endobj - -2015-05-15T00:52:25+02:00 -2015-05-15T00:52:25+02:00 + +2015-05-16T01:22:28+02:00 +2015-05-16T01:22:28+02:00 groff version 1.22.3 - -Untitled + +Untitled @@ -87,8 +87,8 @@ endstream endobj 2 0 obj <>endobj xref 0 16 @@ -110,7 +110,7 @@ xref 0000001640 00000 n trailer << /Size 16 /Root 1 0 R /Info 2 0 R -/ID [] +/ID [<730F81836B3F5E3DEC8DC2EF1122DAB3><730F81836B3F5E3DEC8DC2EF1122DAB3>] >> startxref 3217 diff --git a/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf index 9b8a9d11868..2307459b358 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf index 39d564ada2b..f5986352867 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf index ab40499be7c..8591991f3be 100644 --- a/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf +++ b/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf @@ -69,12 +69,12 @@ endobj - -2015-05-15T00:52:28+02:00 -2015-05-15T00:52:28+02:00 + +2015-05-16T01:22:31+02:00 +2015-05-16T01:22:31+02:00 groff version 1.22.3 - -Untitled + +Untitled @@ -84,8 +84,8 @@ endstream endobj 2 0 obj <>endobj xref 0 15 @@ -106,7 +106,7 @@ xref 0000001722 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R -/ID [<8CEB0281202B71DAFCBE66513AD8B6AE><8CEB0281202B71DAFCBE66513AD8B6AE>] +/ID [<0202FDA7AD2C186CA8FFACFC4F1356DC><0202FDA7AD2C186CA8FFACFC4F1356DC>] >> startxref 3299 diff --git a/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf index 14a20c1c844..41ef1dc1f21 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf index 3d8afa1898c..cb86239888b 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf index c1c952150f3..c817cf0bd05 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf index d0a95cc8537..654074ed505 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf index 47955c5b4b6..22b6382913c 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf index ac16e6f8bcb..48465ad6ab5 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf index 26119dae85e..18bc1d15012 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf b/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf index 70a7ecc35a7..b01becb893e 100644 Binary files a/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf and b/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/texexec.man1.pdf b/Master/texmf-dist/doc/man/man1/texexec.man1.pdf index 3adfe597914..29acf7824fc 100644 Binary files a/Master/texmf-dist/doc/man/man1/texexec.man1.pdf and b/Master/texmf-dist/doc/man/man1/texexec.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/texmfstart.man1.pdf b/Master/texmf-dist/doc/man/man1/texmfstart.man1.pdf index 215e0f0a958..970bf16d228 100644 Binary files a/Master/texmf-dist/doc/man/man1/texmfstart.man1.pdf and b/Master/texmf-dist/doc/man/man1/texmfstart.man1.pdf differ diff --git a/Master/texmf-dist/scripts/context/lua/mtxrun.lua b/Master/texmf-dist/scripts/context/lua/mtxrun.lua index 6afe0fab5b0..edfeba8ddc8 100755 --- a/Master/texmf-dist/scripts/context/lua/mtxrun.lua +++ b/Master/texmf-dist/scripts/context/lua/mtxrun.lua @@ -1372,7 +1372,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 33830, stripped down to: 21894 +-- original size: 35724, stripped down to: 21525 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1405,7 +1405,7 @@ end function table.keys(t) if t then local keys,k={},0 - for key,_ in next,t do + for key in next,t do k=k+1 keys[k]=key end @@ -1416,32 +1416,51 @@ function table.keys(t) end local function compare(a,b) local ta=type(a) - local tb=type(b) - if ta==tb and ta=="number" then - return a1 then + sort(srt) + end return srt else return {} @@ -1469,13 +1490,15 @@ end local function sortedindexonly(tab) if tab then local srt,s={},0 - for key,_ in next,tab do + for key in next,tab do if type(key)=="number" then s=s+1 srt[s]=key end end - sort(srt) + if s>1 then + sort(srt) + end return srt else return {} @@ -1484,13 +1507,15 @@ end local function sortedhashkeys(tab,cmp) if tab then local srt,s={},0 - for key,_ in next,tab do + for key in next,tab do if key then s=s+1 srt[s]=key end end - sort(srt,cmp) + if s>1 then + sort(srt,cmp) + end return srt else return {} @@ -1499,7 +1524,7 @@ end function table.allkeys(t) local keys={} for k,v in next,t do - for k,v in next,v do + for k in next,v do keys[k]=true end end @@ -1518,19 +1543,21 @@ local function sortedhash(t,cmp) else s=sortedkeys(t) end - local n=0 local m=#s - local function kv() - if n0 then + local n=0 + return function() + if n0 then + local nt=#t + if nt>0 then local n=0 for _,v in next,t do n=n+1 end - if n==#t then - local tt,nt={},0 - for i=1,#t do + if n==nt then + local tt={} + for i=1,nt do local v=t[i] local tv=type(v) if tv=="number" then - nt=nt+1 if hexify then - tt[nt]=format("0x%X",v) + tt[i]=format("0x%X",v) else - tt[nt]=tostring(v) + tt[i]=tostring(v) end elseif tv=="string" then - nt=nt+1 - tt[nt]=format("%q",v) + tt[i]=format("%q",v) elseif tv=="boolean" then - nt=nt+1 - tt[nt]=v and "true" or "false" + tt[i]=v and "true" or "false" else - tt=nil - break + return nil end end return tt @@ -1758,7 +1782,8 @@ local function do_serialize(root,name,depth,level,indexed) for i=1,#sk do local k=sk[i] local v=root[k] - local tv,tk=type(v),type(k) + local tv=type(v) + local tk=type(k) if compact and first and tk=="number" and k>=first and k<=last then if tv=="number" then if hexify then @@ -1767,11 +1792,7 @@ local function do_serialize(root,name,depth,level,indexed) handle(format("%s %s,",depth,v)) end elseif tv=="string" then - if reduce and tonumber(v) then - handle(format("%s %s,",depth,v)) - else - handle(format("%s %q,",depth,v)) - end + handle(format("%s %q,",depth,v)) elseif tv=="table" then if next(v)==nil then handle(format("%s {},",depth)) @@ -1827,34 +1848,18 @@ local function do_serialize(root,name,depth,level,indexed) end end elseif tv=="string" then - if reduce and tonumber(v) then - if tk=="number" then - if hexify then - handle(format("%s [0x%X]=%s,",depth,k,v)) - else - handle(format("%s [%s]=%s,",depth,k,v)) - end - elseif tk=="boolean" then - handle(format("%s [%s]=%s,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%s,",depth,k,v)) + if tk=="number" then + if hexify then + handle(format("%s [0x%X]=%q,",depth,k,v)) else - handle(format("%s [%q]=%s,",depth,k,v)) + handle(format("%s [%s]=%q,",depth,k,v)) end + elseif tk=="boolean" then + handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) + elseif noquotes and not reserved[k] and lpegmatch(propername,k) then + handle(format("%s %s=%q,",depth,k,v)) else - if tk=="number" then - if hexify then - handle(format("%s [0x%X]=%q,",depth,k,v)) - else - handle(format("%s [%s]=%q,",depth,k,v)) - end - elseif tk=="boolean" then - handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%q,",depth,k,v)) - else - handle(format("%s [%q]=%q,",depth,k,v)) - end + handle(format("%s [%q]=%q,",depth,k,v)) end elseif tv=="table" then if next(v)==nil then @@ -1951,7 +1956,6 @@ local function serialize(_handle,root,name,specification) noquotes=specification.noquotes hexify=specification.hexify handle=_handle or specification.handle or print - reduce=specification.reduce or false functions=specification.functions compact=specification.compact inline=specification.inline and compact @@ -1968,7 +1972,6 @@ local function serialize(_handle,root,name,specification) noquotes=false hexify=false handle=_handle or print - reduce=false compact=true inline=true functions=true @@ -5882,7 +5885,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 24267, stripped down to: 16260 +-- original size: 25338, stripped down to: 16247 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -5895,7 +5898,7 @@ utilities=utilities or {} 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=table.concat,table.insert,table.remove +local concat,insert,remove,sort=table.concat,table.insert,table.remove,table.sort local setmetatable,getmetatable,tonumber,tostring=setmetatable,getmetatable,tonumber,tostring 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 @@ -6325,7 +6328,8 @@ function table.serialize(root,name,specification) local t local n=1 local function simple_table(t) - if #t>0 then + local nt=#t + if nt>0 then local n=0 for _,v in next,t do n=n+1 @@ -6333,19 +6337,17 @@ function table.serialize(root,name,specification) return nil end end - if n==#t then + if n==nt then local tt={} - local nt=0 - for i=1,#t do + for i=1,nt do local v=t[i] local tv=type(v) - nt=nt+1 if tv=="number" then - tt[nt]=v + tt[i]=v elseif tv=="string" then - tt[nt]=format("%q",v) + tt[i]=format("%q",v) elseif tv=="boolean" then - tt[nt]=v and "true" or "false" + tt[i]=v and "true" or "false" else return nil end @@ -6393,7 +6395,7 @@ function table.serialize(root,name,specification) local v=root[k] local tv=type(v) local tk=type(k) - if first and tk=="number" and k>=first and k<=last then + if first and tk=="number" and k<=last and k>=first then if tv=="number" then n=n+1 t[n]=f_val_num(depth,v) elseif tv=="string" then @@ -6431,11 +6433,11 @@ function table.serialize(root,name,specification) elseif tv=="table" then if next(v)==nil then if tk=="number" then - n=n+1 t[n]=f_key_num_value_not(depth,k,v) + n=n+1 t[n]=f_key_num_value_not(depth,k) elseif tk=="string" then - n=n+1 t[n]=f_key_str_value_not(depth,k,v) + n=n+1 t[n]=f_key_str_value_not(depth,k) elseif tk=="boolean" then - n=n+1 t[n]=f_key_boo_value_not(depth,k,v) + n=n+1 t[n]=f_key_boo_value_not(depth,k) end else local st=simple_table(v) @@ -6650,7 +6652,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-prs"] = package.loaded["util-prs"] or true --- original size: 21751, stripped down to: 15108 +-- original size: 21780, stripped down to: 15121 if not modules then modules={} end modules ['util-prs']={ version=1.001, @@ -6672,6 +6674,8 @@ local patterns=parsers.patterns or {} parsers.patterns=patterns local setmetatableindex=table.setmetatableindex local sortedhash=table.sortedhash +local sortedkeys=table.sortedkeys +local tohash=table.tohash local digit=R("09") local space=P(' ') local equal=P("=") @@ -6721,9 +6725,7 @@ patterns.settings_to_hash_a=pattern_a_s patterns.settings_to_hash_b=pattern_b_s patterns.settings_to_hash_c=pattern_c_s function parsers.make_settings_to_hash_pattern(set,how) - if type(str)=="table" then - return set - elseif how=="strict" then + if how=="strict" then return (pattern_c/set)^1 elseif how=="tolerant" then return (pattern_b/set)^1 @@ -6732,7 +6734,9 @@ function parsers.make_settings_to_hash_pattern(set,how) end end function parsers.settings_to_hash(str,existing) - if type(str)=="table" then + if not str or str=="" then + return {} + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6741,16 +6745,16 @@ function parsers.settings_to_hash(str,existing) else return str end - elseif str and str~="" then + else hash=existing or {} lpegmatch(pattern_a_s,str) return hash - else - return {} end end function parsers.settings_to_hash_tolerant(str,existing) - if type(str)=="table" then + if not str or str=="" then + return {} + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6759,16 +6763,16 @@ function parsers.settings_to_hash_tolerant(str,existing) else return str end - elseif str and str~="" then + else hash=existing or {} lpegmatch(pattern_b_s,str) return hash - else - return {} end end function parsers.settings_to_hash_strict(str,existing) - if type(str)=="table" then + if not str or str=="" then + return nil + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6781,8 +6785,6 @@ function parsers.settings_to_hash_strict(str,existing) hash=existing or {} lpegmatch(pattern_c_s,str) return next(hash) and hash - else - return nil end end local separator=comma*space^0 @@ -6790,10 +6792,10 @@ local value=P(lbrace*C((nobrace+nestedbraces)^0)*rbrace)+C((nestedbraces+(1-comm local pattern=spaces*Ct(value*(separator*value)^0) patterns.settings_to_array=pattern function parsers.settings_to_array(str,strict) - if type(str)=="table" then - return str - elseif not str or str=="" then + if not str or str=="" then return {} + elseif type(str)=="table" then + return str elseif strict then if find(str,"{",1,true) then return lpegmatch(pattern,str) @@ -6854,8 +6856,8 @@ function parsers.add_settings_to_array(t,str) end function parsers.hash_to_string(h,separator,yes,no,strict,omit) if h then - local t,tn,s={},0,table.sortedkeys(h) - omit=omit and table.tohash(omit) + local t,tn,s={},0,sortedkeys(h) + omit=omit and tohash(omit) for i=1,#s do local key=s[i] if not omit or not omit[key] then @@ -7001,7 +7003,7 @@ function parsers.keq_to_hash(str) end local defaultspecification={ separator=",",quote='"' } function parsers.csvsplitter(specification) - specification=specification and table.setmetatableindex(specification,defaultspecification) or defaultspecification + specification=specification and setmetatableindex(specification,defaultspecification) or defaultspecification local separator=specification.separator local quotechar=specification.quote local separator=S(separator~="" and separator or ",") @@ -7025,7 +7027,7 @@ function parsers.csvsplitter(specification) end end function parsers.rfc4180splitter(specification) - specification=specification and table.setmetatableindex(specification,defaultspecification) or defaultspecification + specification=specification and setmetatableindex(specification,defaultspecification) or defaultspecification local separator=specification.separator local quotechar=P(specification.quote) local dquotechar=quotechar*quotechar @@ -7084,9 +7086,9 @@ function parsers.unittoxml(str) return lpegmatch(pattern,str) end local cache={} -local spaces=lpeg.patterns.space^0 +local spaces=lpegpatterns.space^0 local dummy=function() end -table.setmetatableindex(cache,function(t,k) +setmetatableindex(cache,function(t,k) local separator=P(k) local value=(1-separator)^0 local pattern=spaces*C(value)*separator^0*Cp() @@ -14060,7 +14062,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tmp"] = package.loaded["data-tmp"] or true --- original size: 15681, stripped down to: 11761 +-- original size: 15618, stripped down to: 11629 if not modules then modules={} end modules ['data-tmp']={ version=1.100, @@ -14070,7 +14072,7 @@ if not modules then modules={} end modules ['data-tmp']={ license="see context related readme files" } local format,lower,gsub,concat=string.format,string.lower,string.gsub,table.concat -local concat,serialize,serializetofile=table.concat,table.serialize,table.tofile +local concat=table.concat local mkdirs,isdir,isfile=dir.mkdirs,lfs.isdir,lfs.isfile local addsuffix,is_writable,is_readable=file.addsuffix,file.is_writable,file.is_readable local formatters=string.formatters @@ -14339,15 +14341,11 @@ end local saveoptions={ compact=true } function caches.savedata(filepath,filename,data,raw) local tmaname,tmcname=caches.setluanames(filepath,filename) - local reduce,simplify=true,true - if raw then - reduce,simplify=false,false - end data.cache_uuid=os.uuid() if caches.direct then - file.savedata(tmaname,serialize(data,true,saveoptions)) + file.savedata(tmaname,table.serialize(data,true,saveoptions)) else - serializetofile(tmaname,data,true,saveoptions) + table.tofile(tmaname,data,true,saveoptions) end utilities.lua.compile(tmaname,tmcname) end @@ -14412,7 +14410,7 @@ function caches.savecontent(cachename,dataname,content,filename) content=content, uuid=os.uuid(), } - local ok=io.savedata(luaname,serialize(data,true)) + local ok=io.savedata(luaname,table.serialize(data,true)) if ok then if trace_locating then report_resolvers("category %a, cachename %a saved in %a",dataname,cachename,luaname) @@ -17938,8 +17936,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-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 : 742687 --- stripped bytes : 265759 +-- original bytes : 745618 +-- stripped bytes : 269191 -- end library merge diff --git a/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua b/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua index 6afe0fab5b0..edfeba8ddc8 100644 --- a/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua +++ b/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua @@ -1372,7 +1372,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 33830, stripped down to: 21894 +-- original size: 35724, stripped down to: 21525 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1405,7 +1405,7 @@ end function table.keys(t) if t then local keys,k={},0 - for key,_ in next,t do + for key in next,t do k=k+1 keys[k]=key end @@ -1416,32 +1416,51 @@ function table.keys(t) end local function compare(a,b) local ta=type(a) - local tb=type(b) - if ta==tb and ta=="number" then - return a1 then + sort(srt) + end return srt else return {} @@ -1469,13 +1490,15 @@ end local function sortedindexonly(tab) if tab then local srt,s={},0 - for key,_ in next,tab do + for key in next,tab do if type(key)=="number" then s=s+1 srt[s]=key end end - sort(srt) + if s>1 then + sort(srt) + end return srt else return {} @@ -1484,13 +1507,15 @@ end local function sortedhashkeys(tab,cmp) if tab then local srt,s={},0 - for key,_ in next,tab do + for key in next,tab do if key then s=s+1 srt[s]=key end end - sort(srt,cmp) + if s>1 then + sort(srt,cmp) + end return srt else return {} @@ -1499,7 +1524,7 @@ end function table.allkeys(t) local keys={} for k,v in next,t do - for k,v in next,v do + for k in next,v do keys[k]=true end end @@ -1518,19 +1543,21 @@ local function sortedhash(t,cmp) else s=sortedkeys(t) end - local n=0 local m=#s - local function kv() - if n0 then + local n=0 + return function() + if n0 then + local nt=#t + if nt>0 then local n=0 for _,v in next,t do n=n+1 end - if n==#t then - local tt,nt={},0 - for i=1,#t do + if n==nt then + local tt={} + for i=1,nt do local v=t[i] local tv=type(v) if tv=="number" then - nt=nt+1 if hexify then - tt[nt]=format("0x%X",v) + tt[i]=format("0x%X",v) else - tt[nt]=tostring(v) + tt[i]=tostring(v) end elseif tv=="string" then - nt=nt+1 - tt[nt]=format("%q",v) + tt[i]=format("%q",v) elseif tv=="boolean" then - nt=nt+1 - tt[nt]=v and "true" or "false" + tt[i]=v and "true" or "false" else - tt=nil - break + return nil end end return tt @@ -1758,7 +1782,8 @@ local function do_serialize(root,name,depth,level,indexed) for i=1,#sk do local k=sk[i] local v=root[k] - local tv,tk=type(v),type(k) + local tv=type(v) + local tk=type(k) if compact and first and tk=="number" and k>=first and k<=last then if tv=="number" then if hexify then @@ -1767,11 +1792,7 @@ local function do_serialize(root,name,depth,level,indexed) handle(format("%s %s,",depth,v)) end elseif tv=="string" then - if reduce and tonumber(v) then - handle(format("%s %s,",depth,v)) - else - handle(format("%s %q,",depth,v)) - end + handle(format("%s %q,",depth,v)) elseif tv=="table" then if next(v)==nil then handle(format("%s {},",depth)) @@ -1827,34 +1848,18 @@ local function do_serialize(root,name,depth,level,indexed) end end elseif tv=="string" then - if reduce and tonumber(v) then - if tk=="number" then - if hexify then - handle(format("%s [0x%X]=%s,",depth,k,v)) - else - handle(format("%s [%s]=%s,",depth,k,v)) - end - elseif tk=="boolean" then - handle(format("%s [%s]=%s,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%s,",depth,k,v)) + if tk=="number" then + if hexify then + handle(format("%s [0x%X]=%q,",depth,k,v)) else - handle(format("%s [%q]=%s,",depth,k,v)) + handle(format("%s [%s]=%q,",depth,k,v)) end + elseif tk=="boolean" then + handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) + elseif noquotes and not reserved[k] and lpegmatch(propername,k) then + handle(format("%s %s=%q,",depth,k,v)) else - if tk=="number" then - if hexify then - handle(format("%s [0x%X]=%q,",depth,k,v)) - else - handle(format("%s [%s]=%q,",depth,k,v)) - end - elseif tk=="boolean" then - handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%q,",depth,k,v)) - else - handle(format("%s [%q]=%q,",depth,k,v)) - end + handle(format("%s [%q]=%q,",depth,k,v)) end elseif tv=="table" then if next(v)==nil then @@ -1951,7 +1956,6 @@ local function serialize(_handle,root,name,specification) noquotes=specification.noquotes hexify=specification.hexify handle=_handle or specification.handle or print - reduce=specification.reduce or false functions=specification.functions compact=specification.compact inline=specification.inline and compact @@ -1968,7 +1972,6 @@ local function serialize(_handle,root,name,specification) noquotes=false hexify=false handle=_handle or print - reduce=false compact=true inline=true functions=true @@ -5882,7 +5885,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 24267, stripped down to: 16260 +-- original size: 25338, stripped down to: 16247 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -5895,7 +5898,7 @@ utilities=utilities or {} 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=table.concat,table.insert,table.remove +local concat,insert,remove,sort=table.concat,table.insert,table.remove,table.sort local setmetatable,getmetatable,tonumber,tostring=setmetatable,getmetatable,tonumber,tostring 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 @@ -6325,7 +6328,8 @@ function table.serialize(root,name,specification) local t local n=1 local function simple_table(t) - if #t>0 then + local nt=#t + if nt>0 then local n=0 for _,v in next,t do n=n+1 @@ -6333,19 +6337,17 @@ function table.serialize(root,name,specification) return nil end end - if n==#t then + if n==nt then local tt={} - local nt=0 - for i=1,#t do + for i=1,nt do local v=t[i] local tv=type(v) - nt=nt+1 if tv=="number" then - tt[nt]=v + tt[i]=v elseif tv=="string" then - tt[nt]=format("%q",v) + tt[i]=format("%q",v) elseif tv=="boolean" then - tt[nt]=v and "true" or "false" + tt[i]=v and "true" or "false" else return nil end @@ -6393,7 +6395,7 @@ function table.serialize(root,name,specification) local v=root[k] local tv=type(v) local tk=type(k) - if first and tk=="number" and k>=first and k<=last then + if first and tk=="number" and k<=last and k>=first then if tv=="number" then n=n+1 t[n]=f_val_num(depth,v) elseif tv=="string" then @@ -6431,11 +6433,11 @@ function table.serialize(root,name,specification) elseif tv=="table" then if next(v)==nil then if tk=="number" then - n=n+1 t[n]=f_key_num_value_not(depth,k,v) + n=n+1 t[n]=f_key_num_value_not(depth,k) elseif tk=="string" then - n=n+1 t[n]=f_key_str_value_not(depth,k,v) + n=n+1 t[n]=f_key_str_value_not(depth,k) elseif tk=="boolean" then - n=n+1 t[n]=f_key_boo_value_not(depth,k,v) + n=n+1 t[n]=f_key_boo_value_not(depth,k) end else local st=simple_table(v) @@ -6650,7 +6652,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-prs"] = package.loaded["util-prs"] or true --- original size: 21751, stripped down to: 15108 +-- original size: 21780, stripped down to: 15121 if not modules then modules={} end modules ['util-prs']={ version=1.001, @@ -6672,6 +6674,8 @@ local patterns=parsers.patterns or {} parsers.patterns=patterns local setmetatableindex=table.setmetatableindex local sortedhash=table.sortedhash +local sortedkeys=table.sortedkeys +local tohash=table.tohash local digit=R("09") local space=P(' ') local equal=P("=") @@ -6721,9 +6725,7 @@ patterns.settings_to_hash_a=pattern_a_s patterns.settings_to_hash_b=pattern_b_s patterns.settings_to_hash_c=pattern_c_s function parsers.make_settings_to_hash_pattern(set,how) - if type(str)=="table" then - return set - elseif how=="strict" then + if how=="strict" then return (pattern_c/set)^1 elseif how=="tolerant" then return (pattern_b/set)^1 @@ -6732,7 +6734,9 @@ function parsers.make_settings_to_hash_pattern(set,how) end end function parsers.settings_to_hash(str,existing) - if type(str)=="table" then + if not str or str=="" then + return {} + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6741,16 +6745,16 @@ function parsers.settings_to_hash(str,existing) else return str end - elseif str and str~="" then + else hash=existing or {} lpegmatch(pattern_a_s,str) return hash - else - return {} end end function parsers.settings_to_hash_tolerant(str,existing) - if type(str)=="table" then + if not str or str=="" then + return {} + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6759,16 +6763,16 @@ function parsers.settings_to_hash_tolerant(str,existing) else return str end - elseif str and str~="" then + else hash=existing or {} lpegmatch(pattern_b_s,str) return hash - else - return {} end end function parsers.settings_to_hash_strict(str,existing) - if type(str)=="table" then + if not str or str=="" then + return nil + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6781,8 +6785,6 @@ function parsers.settings_to_hash_strict(str,existing) hash=existing or {} lpegmatch(pattern_c_s,str) return next(hash) and hash - else - return nil end end local separator=comma*space^0 @@ -6790,10 +6792,10 @@ local value=P(lbrace*C((nobrace+nestedbraces)^0)*rbrace)+C((nestedbraces+(1-comm local pattern=spaces*Ct(value*(separator*value)^0) patterns.settings_to_array=pattern function parsers.settings_to_array(str,strict) - if type(str)=="table" then - return str - elseif not str or str=="" then + if not str or str=="" then return {} + elseif type(str)=="table" then + return str elseif strict then if find(str,"{",1,true) then return lpegmatch(pattern,str) @@ -6854,8 +6856,8 @@ function parsers.add_settings_to_array(t,str) end function parsers.hash_to_string(h,separator,yes,no,strict,omit) if h then - local t,tn,s={},0,table.sortedkeys(h) - omit=omit and table.tohash(omit) + local t,tn,s={},0,sortedkeys(h) + omit=omit and tohash(omit) for i=1,#s do local key=s[i] if not omit or not omit[key] then @@ -7001,7 +7003,7 @@ function parsers.keq_to_hash(str) end local defaultspecification={ separator=",",quote='"' } function parsers.csvsplitter(specification) - specification=specification and table.setmetatableindex(specification,defaultspecification) or defaultspecification + specification=specification and setmetatableindex(specification,defaultspecification) or defaultspecification local separator=specification.separator local quotechar=specification.quote local separator=S(separator~="" and separator or ",") @@ -7025,7 +7027,7 @@ function parsers.csvsplitter(specification) end end function parsers.rfc4180splitter(specification) - specification=specification and table.setmetatableindex(specification,defaultspecification) or defaultspecification + specification=specification and setmetatableindex(specification,defaultspecification) or defaultspecification local separator=specification.separator local quotechar=P(specification.quote) local dquotechar=quotechar*quotechar @@ -7084,9 +7086,9 @@ function parsers.unittoxml(str) return lpegmatch(pattern,str) end local cache={} -local spaces=lpeg.patterns.space^0 +local spaces=lpegpatterns.space^0 local dummy=function() end -table.setmetatableindex(cache,function(t,k) +setmetatableindex(cache,function(t,k) local separator=P(k) local value=(1-separator)^0 local pattern=spaces*C(value)*separator^0*Cp() @@ -14060,7 +14062,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tmp"] = package.loaded["data-tmp"] or true --- original size: 15681, stripped down to: 11761 +-- original size: 15618, stripped down to: 11629 if not modules then modules={} end modules ['data-tmp']={ version=1.100, @@ -14070,7 +14072,7 @@ if not modules then modules={} end modules ['data-tmp']={ license="see context related readme files" } local format,lower,gsub,concat=string.format,string.lower,string.gsub,table.concat -local concat,serialize,serializetofile=table.concat,table.serialize,table.tofile +local concat=table.concat local mkdirs,isdir,isfile=dir.mkdirs,lfs.isdir,lfs.isfile local addsuffix,is_writable,is_readable=file.addsuffix,file.is_writable,file.is_readable local formatters=string.formatters @@ -14339,15 +14341,11 @@ end local saveoptions={ compact=true } function caches.savedata(filepath,filename,data,raw) local tmaname,tmcname=caches.setluanames(filepath,filename) - local reduce,simplify=true,true - if raw then - reduce,simplify=false,false - end data.cache_uuid=os.uuid() if caches.direct then - file.savedata(tmaname,serialize(data,true,saveoptions)) + file.savedata(tmaname,table.serialize(data,true,saveoptions)) else - serializetofile(tmaname,data,true,saveoptions) + table.tofile(tmaname,data,true,saveoptions) end utilities.lua.compile(tmaname,tmcname) end @@ -14412,7 +14410,7 @@ function caches.savecontent(cachename,dataname,content,filename) content=content, uuid=os.uuid(), } - local ok=io.savedata(luaname,serialize(data,true)) + local ok=io.savedata(luaname,table.serialize(data,true)) if ok then if trace_locating then report_resolvers("category %a, cachename %a saved in %a",dataname,cachename,luaname) @@ -17938,8 +17936,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-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 : 742687 --- stripped bytes : 265759 +-- original bytes : 745618 +-- stripped bytes : 269191 -- end library merge diff --git a/Master/texmf-dist/scripts/context/stubs/unix/mtxrun b/Master/texmf-dist/scripts/context/stubs/unix/mtxrun index 6afe0fab5b0..edfeba8ddc8 100755 --- a/Master/texmf-dist/scripts/context/stubs/unix/mtxrun +++ b/Master/texmf-dist/scripts/context/stubs/unix/mtxrun @@ -1372,7 +1372,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 33830, stripped down to: 21894 +-- original size: 35724, stripped down to: 21525 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1405,7 +1405,7 @@ end function table.keys(t) if t then local keys,k={},0 - for key,_ in next,t do + for key in next,t do k=k+1 keys[k]=key end @@ -1416,32 +1416,51 @@ function table.keys(t) end local function compare(a,b) local ta=type(a) - local tb=type(b) - if ta==tb and ta=="number" then - return a1 then + sort(srt) + end return srt else return {} @@ -1469,13 +1490,15 @@ end local function sortedindexonly(tab) if tab then local srt,s={},0 - for key,_ in next,tab do + for key in next,tab do if type(key)=="number" then s=s+1 srt[s]=key end end - sort(srt) + if s>1 then + sort(srt) + end return srt else return {} @@ -1484,13 +1507,15 @@ end local function sortedhashkeys(tab,cmp) if tab then local srt,s={},0 - for key,_ in next,tab do + for key in next,tab do if key then s=s+1 srt[s]=key end end - sort(srt,cmp) + if s>1 then + sort(srt,cmp) + end return srt else return {} @@ -1499,7 +1524,7 @@ end function table.allkeys(t) local keys={} for k,v in next,t do - for k,v in next,v do + for k in next,v do keys[k]=true end end @@ -1518,19 +1543,21 @@ local function sortedhash(t,cmp) else s=sortedkeys(t) end - local n=0 local m=#s - local function kv() - if n0 then + local n=0 + return function() + if n0 then + local nt=#t + if nt>0 then local n=0 for _,v in next,t do n=n+1 end - if n==#t then - local tt,nt={},0 - for i=1,#t do + if n==nt then + local tt={} + for i=1,nt do local v=t[i] local tv=type(v) if tv=="number" then - nt=nt+1 if hexify then - tt[nt]=format("0x%X",v) + tt[i]=format("0x%X",v) else - tt[nt]=tostring(v) + tt[i]=tostring(v) end elseif tv=="string" then - nt=nt+1 - tt[nt]=format("%q",v) + tt[i]=format("%q",v) elseif tv=="boolean" then - nt=nt+1 - tt[nt]=v and "true" or "false" + tt[i]=v and "true" or "false" else - tt=nil - break + return nil end end return tt @@ -1758,7 +1782,8 @@ local function do_serialize(root,name,depth,level,indexed) for i=1,#sk do local k=sk[i] local v=root[k] - local tv,tk=type(v),type(k) + local tv=type(v) + local tk=type(k) if compact and first and tk=="number" and k>=first and k<=last then if tv=="number" then if hexify then @@ -1767,11 +1792,7 @@ local function do_serialize(root,name,depth,level,indexed) handle(format("%s %s,",depth,v)) end elseif tv=="string" then - if reduce and tonumber(v) then - handle(format("%s %s,",depth,v)) - else - handle(format("%s %q,",depth,v)) - end + handle(format("%s %q,",depth,v)) elseif tv=="table" then if next(v)==nil then handle(format("%s {},",depth)) @@ -1827,34 +1848,18 @@ local function do_serialize(root,name,depth,level,indexed) end end elseif tv=="string" then - if reduce and tonumber(v) then - if tk=="number" then - if hexify then - handle(format("%s [0x%X]=%s,",depth,k,v)) - else - handle(format("%s [%s]=%s,",depth,k,v)) - end - elseif tk=="boolean" then - handle(format("%s [%s]=%s,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%s,",depth,k,v)) + if tk=="number" then + if hexify then + handle(format("%s [0x%X]=%q,",depth,k,v)) else - handle(format("%s [%q]=%s,",depth,k,v)) + handle(format("%s [%s]=%q,",depth,k,v)) end + elseif tk=="boolean" then + handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) + elseif noquotes and not reserved[k] and lpegmatch(propername,k) then + handle(format("%s %s=%q,",depth,k,v)) else - if tk=="number" then - if hexify then - handle(format("%s [0x%X]=%q,",depth,k,v)) - else - handle(format("%s [%s]=%q,",depth,k,v)) - end - elseif tk=="boolean" then - handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%q,",depth,k,v)) - else - handle(format("%s [%q]=%q,",depth,k,v)) - end + handle(format("%s [%q]=%q,",depth,k,v)) end elseif tv=="table" then if next(v)==nil then @@ -1951,7 +1956,6 @@ local function serialize(_handle,root,name,specification) noquotes=specification.noquotes hexify=specification.hexify handle=_handle or specification.handle or print - reduce=specification.reduce or false functions=specification.functions compact=specification.compact inline=specification.inline and compact @@ -1968,7 +1972,6 @@ local function serialize(_handle,root,name,specification) noquotes=false hexify=false handle=_handle or print - reduce=false compact=true inline=true functions=true @@ -5882,7 +5885,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 24267, stripped down to: 16260 +-- original size: 25338, stripped down to: 16247 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -5895,7 +5898,7 @@ utilities=utilities or {} 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=table.concat,table.insert,table.remove +local concat,insert,remove,sort=table.concat,table.insert,table.remove,table.sort local setmetatable,getmetatable,tonumber,tostring=setmetatable,getmetatable,tonumber,tostring 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 @@ -6325,7 +6328,8 @@ function table.serialize(root,name,specification) local t local n=1 local function simple_table(t) - if #t>0 then + local nt=#t + if nt>0 then local n=0 for _,v in next,t do n=n+1 @@ -6333,19 +6337,17 @@ function table.serialize(root,name,specification) return nil end end - if n==#t then + if n==nt then local tt={} - local nt=0 - for i=1,#t do + for i=1,nt do local v=t[i] local tv=type(v) - nt=nt+1 if tv=="number" then - tt[nt]=v + tt[i]=v elseif tv=="string" then - tt[nt]=format("%q",v) + tt[i]=format("%q",v) elseif tv=="boolean" then - tt[nt]=v and "true" or "false" + tt[i]=v and "true" or "false" else return nil end @@ -6393,7 +6395,7 @@ function table.serialize(root,name,specification) local v=root[k] local tv=type(v) local tk=type(k) - if first and tk=="number" and k>=first and k<=last then + if first and tk=="number" and k<=last and k>=first then if tv=="number" then n=n+1 t[n]=f_val_num(depth,v) elseif tv=="string" then @@ -6431,11 +6433,11 @@ function table.serialize(root,name,specification) elseif tv=="table" then if next(v)==nil then if tk=="number" then - n=n+1 t[n]=f_key_num_value_not(depth,k,v) + n=n+1 t[n]=f_key_num_value_not(depth,k) elseif tk=="string" then - n=n+1 t[n]=f_key_str_value_not(depth,k,v) + n=n+1 t[n]=f_key_str_value_not(depth,k) elseif tk=="boolean" then - n=n+1 t[n]=f_key_boo_value_not(depth,k,v) + n=n+1 t[n]=f_key_boo_value_not(depth,k) end else local st=simple_table(v) @@ -6650,7 +6652,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-prs"] = package.loaded["util-prs"] or true --- original size: 21751, stripped down to: 15108 +-- original size: 21780, stripped down to: 15121 if not modules then modules={} end modules ['util-prs']={ version=1.001, @@ -6672,6 +6674,8 @@ local patterns=parsers.patterns or {} parsers.patterns=patterns local setmetatableindex=table.setmetatableindex local sortedhash=table.sortedhash +local sortedkeys=table.sortedkeys +local tohash=table.tohash local digit=R("09") local space=P(' ') local equal=P("=") @@ -6721,9 +6725,7 @@ patterns.settings_to_hash_a=pattern_a_s patterns.settings_to_hash_b=pattern_b_s patterns.settings_to_hash_c=pattern_c_s function parsers.make_settings_to_hash_pattern(set,how) - if type(str)=="table" then - return set - elseif how=="strict" then + if how=="strict" then return (pattern_c/set)^1 elseif how=="tolerant" then return (pattern_b/set)^1 @@ -6732,7 +6734,9 @@ function parsers.make_settings_to_hash_pattern(set,how) end end function parsers.settings_to_hash(str,existing) - if type(str)=="table" then + if not str or str=="" then + return {} + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6741,16 +6745,16 @@ function parsers.settings_to_hash(str,existing) else return str end - elseif str and str~="" then + else hash=existing or {} lpegmatch(pattern_a_s,str) return hash - else - return {} end end function parsers.settings_to_hash_tolerant(str,existing) - if type(str)=="table" then + if not str or str=="" then + return {} + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6759,16 +6763,16 @@ function parsers.settings_to_hash_tolerant(str,existing) else return str end - elseif str and str~="" then + else hash=existing or {} lpegmatch(pattern_b_s,str) return hash - else - return {} end end function parsers.settings_to_hash_strict(str,existing) - if type(str)=="table" then + if not str or str=="" then + return nil + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6781,8 +6785,6 @@ function parsers.settings_to_hash_strict(str,existing) hash=existing or {} lpegmatch(pattern_c_s,str) return next(hash) and hash - else - return nil end end local separator=comma*space^0 @@ -6790,10 +6792,10 @@ local value=P(lbrace*C((nobrace+nestedbraces)^0)*rbrace)+C((nestedbraces+(1-comm local pattern=spaces*Ct(value*(separator*value)^0) patterns.settings_to_array=pattern function parsers.settings_to_array(str,strict) - if type(str)=="table" then - return str - elseif not str or str=="" then + if not str or str=="" then return {} + elseif type(str)=="table" then + return str elseif strict then if find(str,"{",1,true) then return lpegmatch(pattern,str) @@ -6854,8 +6856,8 @@ function parsers.add_settings_to_array(t,str) end function parsers.hash_to_string(h,separator,yes,no,strict,omit) if h then - local t,tn,s={},0,table.sortedkeys(h) - omit=omit and table.tohash(omit) + local t,tn,s={},0,sortedkeys(h) + omit=omit and tohash(omit) for i=1,#s do local key=s[i] if not omit or not omit[key] then @@ -7001,7 +7003,7 @@ function parsers.keq_to_hash(str) end local defaultspecification={ separator=",",quote='"' } function parsers.csvsplitter(specification) - specification=specification and table.setmetatableindex(specification,defaultspecification) or defaultspecification + specification=specification and setmetatableindex(specification,defaultspecification) or defaultspecification local separator=specification.separator local quotechar=specification.quote local separator=S(separator~="" and separator or ",") @@ -7025,7 +7027,7 @@ function parsers.csvsplitter(specification) end end function parsers.rfc4180splitter(specification) - specification=specification and table.setmetatableindex(specification,defaultspecification) or defaultspecification + specification=specification and setmetatableindex(specification,defaultspecification) or defaultspecification local separator=specification.separator local quotechar=P(specification.quote) local dquotechar=quotechar*quotechar @@ -7084,9 +7086,9 @@ function parsers.unittoxml(str) return lpegmatch(pattern,str) end local cache={} -local spaces=lpeg.patterns.space^0 +local spaces=lpegpatterns.space^0 local dummy=function() end -table.setmetatableindex(cache,function(t,k) +setmetatableindex(cache,function(t,k) local separator=P(k) local value=(1-separator)^0 local pattern=spaces*C(value)*separator^0*Cp() @@ -14060,7 +14062,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tmp"] = package.loaded["data-tmp"] or true --- original size: 15681, stripped down to: 11761 +-- original size: 15618, stripped down to: 11629 if not modules then modules={} end modules ['data-tmp']={ version=1.100, @@ -14070,7 +14072,7 @@ if not modules then modules={} end modules ['data-tmp']={ license="see context related readme files" } local format,lower,gsub,concat=string.format,string.lower,string.gsub,table.concat -local concat,serialize,serializetofile=table.concat,table.serialize,table.tofile +local concat=table.concat local mkdirs,isdir,isfile=dir.mkdirs,lfs.isdir,lfs.isfile local addsuffix,is_writable,is_readable=file.addsuffix,file.is_writable,file.is_readable local formatters=string.formatters @@ -14339,15 +14341,11 @@ end local saveoptions={ compact=true } function caches.savedata(filepath,filename,data,raw) local tmaname,tmcname=caches.setluanames(filepath,filename) - local reduce,simplify=true,true - if raw then - reduce,simplify=false,false - end data.cache_uuid=os.uuid() if caches.direct then - file.savedata(tmaname,serialize(data,true,saveoptions)) + file.savedata(tmaname,table.serialize(data,true,saveoptions)) else - serializetofile(tmaname,data,true,saveoptions) + table.tofile(tmaname,data,true,saveoptions) end utilities.lua.compile(tmaname,tmcname) end @@ -14412,7 +14410,7 @@ function caches.savecontent(cachename,dataname,content,filename) content=content, uuid=os.uuid(), } - local ok=io.savedata(luaname,serialize(data,true)) + local ok=io.savedata(luaname,table.serialize(data,true)) if ok then if trace_locating then report_resolvers("category %a, cachename %a saved in %a",dataname,cachename,luaname) @@ -17938,8 +17936,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-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 : 742687 --- stripped bytes : 265759 +-- original bytes : 745618 +-- stripped bytes : 269191 -- end library merge diff --git a/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua b/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua index 6afe0fab5b0..edfeba8ddc8 100644 --- a/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua +++ b/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua @@ -1372,7 +1372,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 33830, stripped down to: 21894 +-- original size: 35724, stripped down to: 21525 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1405,7 +1405,7 @@ end function table.keys(t) if t then local keys,k={},0 - for key,_ in next,t do + for key in next,t do k=k+1 keys[k]=key end @@ -1416,32 +1416,51 @@ function table.keys(t) end local function compare(a,b) local ta=type(a) - local tb=type(b) - if ta==tb and ta=="number" then - return a1 then + sort(srt) + end return srt else return {} @@ -1469,13 +1490,15 @@ end local function sortedindexonly(tab) if tab then local srt,s={},0 - for key,_ in next,tab do + for key in next,tab do if type(key)=="number" then s=s+1 srt[s]=key end end - sort(srt) + if s>1 then + sort(srt) + end return srt else return {} @@ -1484,13 +1507,15 @@ end local function sortedhashkeys(tab,cmp) if tab then local srt,s={},0 - for key,_ in next,tab do + for key in next,tab do if key then s=s+1 srt[s]=key end end - sort(srt,cmp) + if s>1 then + sort(srt,cmp) + end return srt else return {} @@ -1499,7 +1524,7 @@ end function table.allkeys(t) local keys={} for k,v in next,t do - for k,v in next,v do + for k in next,v do keys[k]=true end end @@ -1518,19 +1543,21 @@ local function sortedhash(t,cmp) else s=sortedkeys(t) end - local n=0 local m=#s - local function kv() - if n0 then + local n=0 + return function() + if n0 then + local nt=#t + if nt>0 then local n=0 for _,v in next,t do n=n+1 end - if n==#t then - local tt,nt={},0 - for i=1,#t do + if n==nt then + local tt={} + for i=1,nt do local v=t[i] local tv=type(v) if tv=="number" then - nt=nt+1 if hexify then - tt[nt]=format("0x%X",v) + tt[i]=format("0x%X",v) else - tt[nt]=tostring(v) + tt[i]=tostring(v) end elseif tv=="string" then - nt=nt+1 - tt[nt]=format("%q",v) + tt[i]=format("%q",v) elseif tv=="boolean" then - nt=nt+1 - tt[nt]=v and "true" or "false" + tt[i]=v and "true" or "false" else - tt=nil - break + return nil end end return tt @@ -1758,7 +1782,8 @@ local function do_serialize(root,name,depth,level,indexed) for i=1,#sk do local k=sk[i] local v=root[k] - local tv,tk=type(v),type(k) + local tv=type(v) + local tk=type(k) if compact and first and tk=="number" and k>=first and k<=last then if tv=="number" then if hexify then @@ -1767,11 +1792,7 @@ local function do_serialize(root,name,depth,level,indexed) handle(format("%s %s,",depth,v)) end elseif tv=="string" then - if reduce and tonumber(v) then - handle(format("%s %s,",depth,v)) - else - handle(format("%s %q,",depth,v)) - end + handle(format("%s %q,",depth,v)) elseif tv=="table" then if next(v)==nil then handle(format("%s {},",depth)) @@ -1827,34 +1848,18 @@ local function do_serialize(root,name,depth,level,indexed) end end elseif tv=="string" then - if reduce and tonumber(v) then - if tk=="number" then - if hexify then - handle(format("%s [0x%X]=%s,",depth,k,v)) - else - handle(format("%s [%s]=%s,",depth,k,v)) - end - elseif tk=="boolean" then - handle(format("%s [%s]=%s,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%s,",depth,k,v)) + if tk=="number" then + if hexify then + handle(format("%s [0x%X]=%q,",depth,k,v)) else - handle(format("%s [%q]=%s,",depth,k,v)) + handle(format("%s [%s]=%q,",depth,k,v)) end + elseif tk=="boolean" then + handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) + elseif noquotes and not reserved[k] and lpegmatch(propername,k) then + handle(format("%s %s=%q,",depth,k,v)) else - if tk=="number" then - if hexify then - handle(format("%s [0x%X]=%q,",depth,k,v)) - else - handle(format("%s [%s]=%q,",depth,k,v)) - end - elseif tk=="boolean" then - handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%q,",depth,k,v)) - else - handle(format("%s [%q]=%q,",depth,k,v)) - end + handle(format("%s [%q]=%q,",depth,k,v)) end elseif tv=="table" then if next(v)==nil then @@ -1951,7 +1956,6 @@ local function serialize(_handle,root,name,specification) noquotes=specification.noquotes hexify=specification.hexify handle=_handle or specification.handle or print - reduce=specification.reduce or false functions=specification.functions compact=specification.compact inline=specification.inline and compact @@ -1968,7 +1972,6 @@ local function serialize(_handle,root,name,specification) noquotes=false hexify=false handle=_handle or print - reduce=false compact=true inline=true functions=true @@ -5882,7 +5885,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-tab"] = package.loaded["util-tab"] or true --- original size: 24267, stripped down to: 16260 +-- original size: 25338, stripped down to: 16247 if not modules then modules={} end modules ['util-tab']={ version=1.001, @@ -5895,7 +5898,7 @@ utilities=utilities or {} 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=table.concat,table.insert,table.remove +local concat,insert,remove,sort=table.concat,table.insert,table.remove,table.sort local setmetatable,getmetatable,tonumber,tostring=setmetatable,getmetatable,tonumber,tostring 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 @@ -6325,7 +6328,8 @@ function table.serialize(root,name,specification) local t local n=1 local function simple_table(t) - if #t>0 then + local nt=#t + if nt>0 then local n=0 for _,v in next,t do n=n+1 @@ -6333,19 +6337,17 @@ function table.serialize(root,name,specification) return nil end end - if n==#t then + if n==nt then local tt={} - local nt=0 - for i=1,#t do + for i=1,nt do local v=t[i] local tv=type(v) - nt=nt+1 if tv=="number" then - tt[nt]=v + tt[i]=v elseif tv=="string" then - tt[nt]=format("%q",v) + tt[i]=format("%q",v) elseif tv=="boolean" then - tt[nt]=v and "true" or "false" + tt[i]=v and "true" or "false" else return nil end @@ -6393,7 +6395,7 @@ function table.serialize(root,name,specification) local v=root[k] local tv=type(v) local tk=type(k) - if first and tk=="number" and k>=first and k<=last then + if first and tk=="number" and k<=last and k>=first then if tv=="number" then n=n+1 t[n]=f_val_num(depth,v) elseif tv=="string" then @@ -6431,11 +6433,11 @@ function table.serialize(root,name,specification) elseif tv=="table" then if next(v)==nil then if tk=="number" then - n=n+1 t[n]=f_key_num_value_not(depth,k,v) + n=n+1 t[n]=f_key_num_value_not(depth,k) elseif tk=="string" then - n=n+1 t[n]=f_key_str_value_not(depth,k,v) + n=n+1 t[n]=f_key_str_value_not(depth,k) elseif tk=="boolean" then - n=n+1 t[n]=f_key_boo_value_not(depth,k,v) + n=n+1 t[n]=f_key_boo_value_not(depth,k) end else local st=simple_table(v) @@ -6650,7 +6652,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-prs"] = package.loaded["util-prs"] or true --- original size: 21751, stripped down to: 15108 +-- original size: 21780, stripped down to: 15121 if not modules then modules={} end modules ['util-prs']={ version=1.001, @@ -6672,6 +6674,8 @@ local patterns=parsers.patterns or {} parsers.patterns=patterns local setmetatableindex=table.setmetatableindex local sortedhash=table.sortedhash +local sortedkeys=table.sortedkeys +local tohash=table.tohash local digit=R("09") local space=P(' ') local equal=P("=") @@ -6721,9 +6725,7 @@ patterns.settings_to_hash_a=pattern_a_s patterns.settings_to_hash_b=pattern_b_s patterns.settings_to_hash_c=pattern_c_s function parsers.make_settings_to_hash_pattern(set,how) - if type(str)=="table" then - return set - elseif how=="strict" then + if how=="strict" then return (pattern_c/set)^1 elseif how=="tolerant" then return (pattern_b/set)^1 @@ -6732,7 +6734,9 @@ function parsers.make_settings_to_hash_pattern(set,how) end end function parsers.settings_to_hash(str,existing) - if type(str)=="table" then + if not str or str=="" then + return {} + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6741,16 +6745,16 @@ function parsers.settings_to_hash(str,existing) else return str end - elseif str and str~="" then + else hash=existing or {} lpegmatch(pattern_a_s,str) return hash - else - return {} end end function parsers.settings_to_hash_tolerant(str,existing) - if type(str)=="table" then + if not str or str=="" then + return {} + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6759,16 +6763,16 @@ function parsers.settings_to_hash_tolerant(str,existing) else return str end - elseif str and str~="" then + else hash=existing or {} lpegmatch(pattern_b_s,str) return hash - else - return {} end end function parsers.settings_to_hash_strict(str,existing) - if type(str)=="table" then + if not str or str=="" then + return nil + elseif type(str)=="table" then if existing then for k,v in next,str do existing[k]=v @@ -6781,8 +6785,6 @@ function parsers.settings_to_hash_strict(str,existing) hash=existing or {} lpegmatch(pattern_c_s,str) return next(hash) and hash - else - return nil end end local separator=comma*space^0 @@ -6790,10 +6792,10 @@ local value=P(lbrace*C((nobrace+nestedbraces)^0)*rbrace)+C((nestedbraces+(1-comm local pattern=spaces*Ct(value*(separator*value)^0) patterns.settings_to_array=pattern function parsers.settings_to_array(str,strict) - if type(str)=="table" then - return str - elseif not str or str=="" then + if not str or str=="" then return {} + elseif type(str)=="table" then + return str elseif strict then if find(str,"{",1,true) then return lpegmatch(pattern,str) @@ -6854,8 +6856,8 @@ function parsers.add_settings_to_array(t,str) end function parsers.hash_to_string(h,separator,yes,no,strict,omit) if h then - local t,tn,s={},0,table.sortedkeys(h) - omit=omit and table.tohash(omit) + local t,tn,s={},0,sortedkeys(h) + omit=omit and tohash(omit) for i=1,#s do local key=s[i] if not omit or not omit[key] then @@ -7001,7 +7003,7 @@ function parsers.keq_to_hash(str) end local defaultspecification={ separator=",",quote='"' } function parsers.csvsplitter(specification) - specification=specification and table.setmetatableindex(specification,defaultspecification) or defaultspecification + specification=specification and setmetatableindex(specification,defaultspecification) or defaultspecification local separator=specification.separator local quotechar=specification.quote local separator=S(separator~="" and separator or ",") @@ -7025,7 +7027,7 @@ function parsers.csvsplitter(specification) end end function parsers.rfc4180splitter(specification) - specification=specification and table.setmetatableindex(specification,defaultspecification) or defaultspecification + specification=specification and setmetatableindex(specification,defaultspecification) or defaultspecification local separator=specification.separator local quotechar=P(specification.quote) local dquotechar=quotechar*quotechar @@ -7084,9 +7086,9 @@ function parsers.unittoxml(str) return lpegmatch(pattern,str) end local cache={} -local spaces=lpeg.patterns.space^0 +local spaces=lpegpatterns.space^0 local dummy=function() end -table.setmetatableindex(cache,function(t,k) +setmetatableindex(cache,function(t,k) local separator=P(k) local value=(1-separator)^0 local pattern=spaces*C(value)*separator^0*Cp() @@ -14060,7 +14062,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tmp"] = package.loaded["data-tmp"] or true --- original size: 15681, stripped down to: 11761 +-- original size: 15618, stripped down to: 11629 if not modules then modules={} end modules ['data-tmp']={ version=1.100, @@ -14070,7 +14072,7 @@ if not modules then modules={} end modules ['data-tmp']={ license="see context related readme files" } local format,lower,gsub,concat=string.format,string.lower,string.gsub,table.concat -local concat,serialize,serializetofile=table.concat,table.serialize,table.tofile +local concat=table.concat local mkdirs,isdir,isfile=dir.mkdirs,lfs.isdir,lfs.isfile local addsuffix,is_writable,is_readable=file.addsuffix,file.is_writable,file.is_readable local formatters=string.formatters @@ -14339,15 +14341,11 @@ end local saveoptions={ compact=true } function caches.savedata(filepath,filename,data,raw) local tmaname,tmcname=caches.setluanames(filepath,filename) - local reduce,simplify=true,true - if raw then - reduce,simplify=false,false - end data.cache_uuid=os.uuid() if caches.direct then - file.savedata(tmaname,serialize(data,true,saveoptions)) + file.savedata(tmaname,table.serialize(data,true,saveoptions)) else - serializetofile(tmaname,data,true,saveoptions) + table.tofile(tmaname,data,true,saveoptions) end utilities.lua.compile(tmaname,tmcname) end @@ -14412,7 +14410,7 @@ function caches.savecontent(cachename,dataname,content,filename) content=content, uuid=os.uuid(), } - local ok=io.savedata(luaname,serialize(data,true)) + local ok=io.savedata(luaname,table.serialize(data,true)) if ok then if trace_locating then report_resolvers("category %a, cachename %a saved in %a",dataname,cachename,luaname) @@ -17938,8 +17936,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-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 : 742687 --- stripped bytes : 265759 +-- original bytes : 745618 +-- stripped bytes : 269191 -- end library merge diff --git a/Master/texmf-dist/tex/context/base/cont-new.mkiv b/Master/texmf-dist/tex/context/base/cont-new.mkiv index cf38042b642..e9f25937606 100644 --- a/Master/texmf-dist/tex/context/base/cont-new.mkiv +++ b/Master/texmf-dist/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2015.05.13 23:52} +\newcontextversion{2015.05.15 23:03} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/Master/texmf-dist/tex/context/base/context-version.pdf b/Master/texmf-dist/tex/context/base/context-version.pdf index cd9ca783da5..1145082b449 100644 Binary files a/Master/texmf-dist/tex/context/base/context-version.pdf and b/Master/texmf-dist/tex/context/base/context-version.pdf differ diff --git a/Master/texmf-dist/tex/context/base/context.mkiv b/Master/texmf-dist/tex/context/base/context.mkiv index a775cfa0207..389d784e41a 100644 --- a/Master/texmf-dist/tex/context/base/context.mkiv +++ b/Master/texmf-dist/tex/context/base/context.mkiv @@ -39,8 +39,8 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2015.05.13 23:52} -\edef\contextkind {beta} +\edef\contextversion{2015.05.15 23:03} +\edef\contextkind {current} %D For those who want to use this: diff --git a/Master/texmf-dist/tex/context/base/core-con.lua b/Master/texmf-dist/tex/context/base/core-con.lua index be462e1d2f2..37942ae7169 100644 --- a/Master/texmf-dist/tex/context/base/core-con.lua +++ b/Master/texmf-dist/tex/context/base/core-con.lua @@ -807,7 +807,7 @@ end implement { name = "ordinal", actions = ctxordinal, - arguments = { "string", "string" } + arguments = { "integer", "string" } } -- verbose numbers diff --git a/Master/texmf-dist/tex/context/base/core-sys.mkiv b/Master/texmf-dist/tex/context/base/core-sys.mkiv index 27bbec0b103..3d31dee53d6 100644 --- a/Master/texmf-dist/tex/context/base/core-sys.mkiv +++ b/Master/texmf-dist/tex/context/base/core-sys.mkiv @@ -208,27 +208,29 @@ \to \everydefinestartstop \unexpanded\def\syst_startstop_start#1% - {\namedstartstopparameter{#1}\c!before + {\namedstartstopparameter{#1}\c!before\relax \bgroup \def\currentstartstop{#1}% - \startstopparameter\c!commands + \startstopparameter\c!commands\relax % better: setups so that will show op soon \dostarttagged\t!construct\currentstartstop \usestartstopstyleandcolor\c!style\c!color} \unexpanded\def\syst_startstop_stop#1% {\dostoptagged \egroup - \namedstartstopparameter{#1}\c!after} + \namedstartstopparameter{#1}\c!after\relax} \unexpanded\def\syst_startstop_indeed#1% {\groupedcommand {\def\currentstartstop{#1}% - \startstopparameter\c!commands % will become setups + \startstopparameter\c!commands\relax % better: setups so that will show op soon \dostarttagged\t!construct\currentstartstop - \usestartstopstyleandcolor\c!style\c!color} - {\def\currentstartstop{#1}% + \usestartstopstyleandcolor\c!style\c!color + \startstopparameter\c!left\relax} + {\def\currentstartstop{#1}% safeguard, nto really needed + \startstopparameter\c!right\relax \dostoptagged - \startstopparameter\c!inbetween}} + \startstopparameter\c!inbetween\relax}} % \definestartstop[tracing][\c!style=\tt] diff --git a/Master/texmf-dist/tex/context/base/data-tmp.lua b/Master/texmf-dist/tex/context/base/data-tmp.lua index 8ee5792cc48..9e1515a2650 100644 --- a/Master/texmf-dist/tex/context/base/data-tmp.lua +++ b/Master/texmf-dist/tex/context/base/data-tmp.lua @@ -23,7 +23,8 @@ luatools with a recache feature.

--ldx]]-- local format, lower, gsub, concat = string.format, string.lower, string.gsub, table.concat -local concat, serialize, serializetofile = table.concat, table.serialize, table.tofile +----- serialize, serializetofile = table.serialize, table.tofile -- overloaded so no local +local concat = table.concat local mkdirs, isdir, isfile = dir.mkdirs, lfs.isdir, lfs.isfile local addsuffix, is_writable, is_readable = file.addsuffix, file.is_writable, file.is_readable local formatters = string.formatters @@ -349,15 +350,11 @@ local saveoptions = { compact = true } function caches.savedata(filepath,filename,data,raw) local tmaname, tmcname = caches.setluanames(filepath,filename) - local reduce, simplify = true, true - if raw then - reduce, simplify = false, false - end data.cache_uuid = os.uuid() if caches.direct then - file.savedata(tmaname,serialize(data,true,saveoptions)) + file.savedata(tmaname,table.serialize(data,true,saveoptions)) else - serializetofile(tmaname,data,true,saveoptions) + table.tofile(tmaname,data,true,saveoptions) end utilities.lua.compile(tmaname,tmcname) end @@ -429,7 +426,7 @@ function caches.savecontent(cachename,dataname,content,filename) content = content, uuid = os.uuid(), } - local ok = io.savedata(luaname,serialize(data,true)) + local ok = io.savedata(luaname,table.serialize(data,true)) if ok then if trace_locating then report_resolvers("category %a, cachename %a saved in %a",dataname,cachename,luaname) diff --git a/Master/texmf-dist/tex/context/base/font-otn.lua b/Master/texmf-dist/tex/context/base/font-otn.lua index 440eb34ec8e..b1bd4530478 100644 --- a/Master/texmf-dist/tex/context/base/font-otn.lua +++ b/Master/texmf-dist/tex/context/base/font-otn.lua @@ -2085,7 +2085,7 @@ local function normal_handle_contextchain(head,start,kind,chainname,contexts,seq if not replace then break elseif n > l then --- match = false + -- match = false break end else @@ -2163,7 +2163,7 @@ local function normal_handle_contextchain(head,start,kind,chainname,contexts,seq if not replace or replace == finish then break elseif n < 1 then --- match = false + -- match = false break end else @@ -2196,17 +2196,8 @@ local function normal_handle_contextchain(head,start,kind,chainname,contexts,seq break end end - elseif f == 2 then - match = seq[1][32] --- elseif f > 2 then --- match = false -- KE ? else - for n=f-1,1 do - if not seq[n][32] then - match = false - break - end - end + match = false end end -- after @@ -2287,15 +2278,8 @@ local function normal_handle_contextchain(head,start,kind,chainname,contexts,seq break end end - elseif s-l == 1 then - match = seq[s][32] else - for n=l+1,s do - if not seq[n][32] then - match = false - break - end - end + match = false end end end diff --git a/Master/texmf-dist/tex/context/base/font-otp.lua b/Master/texmf-dist/tex/context/base/font-otp.lua index 63e4184c19a..ebf36ed45d0 100644 --- a/Master/texmf-dist/tex/context/base/font-otp.lua +++ b/Master/texmf-dist/tex/context/base/font-otp.lua @@ -9,6 +9,8 @@ if not modules then modules = { } end modules ['font-otp'] = { -- todo: pack math (but not that much to share) -- -- pitfall 5.2: hashed tables can suddenly become indexed with nil slots +-- +-- unless we sort all hashes we can get a different pack order (no big deal but size can differ) local next, type = next, type local sort, concat = table.sort, table.concat diff --git a/Master/texmf-dist/tex/context/base/font-sty.mkvi b/Master/texmf-dist/tex/context/base/font-sty.mkvi index 673cf25aecd..5924a30338c 100644 --- a/Master/texmf-dist/tex/context/base/font-sty.mkvi +++ b/Master/texmf-dist/tex/context/base/font-sty.mkvi @@ -352,7 +352,7 @@ \def\font_styles_define_style_instance[#instance][#2][#3][#4]% [name] [rm|ss|tt|..] [sl|bf|...] [whatever] {\iffirstargument - \ifcsname#1\endcsname\else\font_styles_define_style_collection[#instance]\fi + \ifcsname#instance\endcsname\else\font_styles_define_style_collection[#instance]\fi \fi \iffourthargument \setvalue{\??stylecollection#instance:#2:#3}{#4}% diff --git a/Master/texmf-dist/tex/context/base/l-table.lua b/Master/texmf-dist/tex/context/base/l-table.lua index 97e0441eb09..b02f210cb94 100644 --- a/Master/texmf-dist/tex/context/base/l-table.lua +++ b/Master/texmf-dist/tex/context/base/l-table.lua @@ -39,7 +39,7 @@ end function table.keys(t) if t then local keys, k = { }, 0 - for key, _ in next, t do + for key in next, t do k = k + 1 keys[k] = key end @@ -50,44 +50,126 @@ function table.keys(t) end -- local function compare(a,b) --- local ta, tb = type(a), type(b) -- needed, else 11 < 2 --- if ta == tb then +-- local ta = type(a) -- needed, else 11 < 2 +-- local tb = type(b) -- needed, else 11 < 2 +-- if ta == tb and ta == "number" then -- return a < b -- else -- return tostring(a) < tostring(b) -- not that efficient -- end -- end +-- local function compare(a,b) +-- local ta = type(a) -- needed, else 11 < 2 +-- local tb = type(b) -- needed, else 11 < 2 +-- if ta == tb and (ta == "number" or ta == "string") then +-- return a < b +-- else +-- return tostring(a) < tostring(b) -- not that efficient +-- end +-- end + +-- local function sortedkeys(tab) +-- if tab then +-- local srt, category, s = { }, 0, 0 -- 0=unknown 1=string, 2=number 3=mixed +-- for key in next, tab do +-- s = s + 1 +-- srt[s] = key +-- if category == 3 then +-- -- no further check +-- else +-- local tkey = type(key) +-- if tkey == "string" then +-- category = (category == 2 and 3) or 1 +-- elseif tkey == "number" then +-- category = (category == 1 and 3) or 2 +-- else +-- category = 3 +-- end +-- end +-- end +-- if category == 0 or category == 3 then +-- sort(srt,compare) +-- else +-- sort(srt) +-- end +-- return srt +-- else +-- return { } +-- end +-- end + +-- local function compare(a,b) +-- local ta = type(a) -- needed, else 11 < 2 +-- local tb = type(b) -- needed, else 11 < 2 +-- if ta == tb and (ta == "number" or ta == "string") then +-- return a < b +-- else +-- return tostring(a) < tostring(b) -- not that efficient +-- end +-- end + +-- local function compare(a,b) +-- local ta = type(a) -- needed, else 11 < 2 +-- if ta == "number" or ta == "string" then +-- local tb = type(b) -- needed, else 11 < 2 +-- if ta == tb then +-- return a < b +-- end +-- end +-- return tostring(a) < tostring(b) -- not that efficient +-- end + local function compare(a,b) local ta = type(a) -- needed, else 11 < 2 - local tb = type(b) -- needed, else 11 < 2 - if ta == tb and ta == "number" then - return a < b - else - return tostring(a) < tostring(b) -- not that efficient + if ta == "number" then + local tb = type(b) -- needed, else 11 < 2 + if ta == tb then + return a < b + elseif tb == "string" then + return tostring(a) < b + end + elseif ta == "string" then + local tb = type(b) -- needed, else 11 < 2 + if ta == tb then + return a < b + else + return a < tostring(b) + end end + return tostring(a) < tostring(b) -- not that efficient end local function sortedkeys(tab) if tab then local srt, category, s = { }, 0, 0 -- 0=unknown 1=string, 2=number 3=mixed - for key,_ in next, tab do + for key in next, tab do s = s + 1 srt[s] = key if category == 3 then -- no further check + elseif category == 1 then + if type(key) ~= "string" then + category = 3 + end + elseif category == 2 then + if type(key) ~= "number" then + category = 3 + end else local tkey = type(key) if tkey == "string" then - category = (category == 2 and 3) or 1 + category = 1 elseif tkey == "number" then - category = (category == 1 and 3) or 2 + category = 2 else category = 3 end end end - if category == 0 or category == 3 then + if s < 2 then + -- nothing to sort + elseif category == 3 then sort(srt,compare) else sort(srt) @@ -101,13 +183,15 @@ end local function sortedhashonly(tab) if tab then local srt, s = { }, 0 - for key,_ in next, tab do + for key in next, tab do if type(key) == "string" then s = s + 1 srt[s] = key end end - sort(srt) + if s > 1 then + sort(srt) + end return srt else return { } @@ -117,13 +201,15 @@ end local function sortedindexonly(tab) if tab then local srt, s = { }, 0 - for key,_ in next, tab do + for key in next, tab do if type(key) == "number" then s = s + 1 srt[s] = key end end - sort(srt) + if s > 1 then + sort(srt) + end return srt else return { } @@ -133,13 +219,15 @@ end local function sortedhashkeys(tab,cmp) -- fast one if tab then local srt, s = { }, 0 - for key,_ in next, tab do + for key in next, tab do if key then s= s + 1 srt[s] = key end end - sort(srt,cmp) + if s > 1 then + sort(srt,cmp) + end return srt else return { } @@ -149,7 +237,7 @@ end function table.allkeys(t) local keys = { } for k, v in next, t do - for k, v in next, v do + for k in next, v do keys[k] = true end end @@ -172,19 +260,21 @@ local function sortedhash(t,cmp) else s = sortedkeys(t) -- the robust one end - local n = 0 local m = #s - local function kv() -- (s) - if n < m then - n = n + 1 - local k = s[n] - return k, t[k] + if m == 1 then + return next, t + elseif m > 0 then + local n = 0 + return function() + if n < m then + n = n + 1 + local k = s[n] + return k, t[k] + end end end - return kv -- , s - else - return nothing end + return nothing end table.sortedhash = sortedhash @@ -328,7 +418,7 @@ end local function copy(t, tables) -- taken from lua wiki, slightly adapted tables = tables or { } - local tcopy = {} + local tcopy = { } if not tables[t] then tables[t] = tcopy end @@ -388,7 +478,7 @@ function table.fromhash(t) return hsh end -local noquotes, hexify, handle, reduce, compact, inline, functions +local noquotes, hexify, handle, compact, inline, functions local reserved = table.tohash { -- intercept a language inconvenience: no reserved words as key 'and', 'break', 'do', 'else', 'elseif', 'end', 'false', 'for', 'function', 'if', @@ -396,33 +486,67 @@ local reserved = table.tohash { -- intercept a language inconvenience: no reserv 'NaN', 'goto', } +-- local function simple_table(t) +-- if #t > 0 then +-- local n = 0 +-- for _,v in next, t do +-- n = n + 1 +-- end +-- if n == #t then +-- local tt, nt = { }, 0 +-- for i=1,#t do +-- local v = t[i] +-- local tv = type(v) +-- if tv == "number" then +-- nt = nt + 1 +-- if hexify then +-- tt[nt] = format("0x%X",v) +-- else +-- tt[nt] = tostring(v) -- tostring not needed +-- end +-- elseif tv == "string" then +-- nt = nt + 1 +-- tt[nt] = format("%q",v) +-- elseif tv == "boolean" then +-- nt = nt + 1 +-- tt[nt] = v and "true" or "false" +-- else +-- return nil +-- end +-- end +-- return tt +-- end +-- end +-- return nil +-- end + local function simple_table(t) - if #t > 0 then + local nt = #t + if nt > 0 then local n = 0 for _,v in next, t do n = n + 1 + -- if type(v) == "table" then + -- return nil + -- end end - if n == #t then - local tt, nt = { }, 0 - for i=1,#t do + if n == nt then + local tt = { } + for i=1,nt do local v = t[i] local tv = type(v) if tv == "number" then - nt = nt + 1 if hexify then - tt[nt] = format("0x%X",v) + tt[i] = format("0x%X",v) else - tt[nt] = tostring(v) -- tostring not needed + tt[i] = tostring(v) -- tostring not needed end elseif tv == "string" then - nt = nt + 1 - tt[nt] = format("%q",v) + tt[i] = format("%q",v) elseif tv == "boolean" then - nt = nt + 1 - tt[nt] = v and "true" or "false" + tt[i] = v and "true" or "false" else - tt = nil - break + return nil end end return tt @@ -480,14 +604,6 @@ local function do_serialize(root,name,depth,level,indexed) end -- we could check for k (index) being number (cardinal) if root and next(root) ~= nil then - -- local first, last = nil, 0 -- #root cannot be trusted here (will be ok in 5.2 when ipairs is gone) - -- if compact then - -- -- NOT: for k=1,#root do (we need to quit at nil) - -- for k,v in ipairs(root) do -- can we use next? - -- if not first then first = k end - -- last = last + 1 - -- end - -- end local first, last = nil, 0 if compact then last = #root @@ -503,12 +619,10 @@ local function do_serialize(root,name,depth,level,indexed) end local sk = sortedkeys(root) for i=1,#sk do - local k = sk[i] - local v = root[k] - --~ if v == root then - -- circular - --~ else - local tv, tk = type(v), type(k) + local k = sk[i] + local v = root[k] + local tv = type(v) + local tk = type(k) if compact and first and tk == "number" and k >= first and k <= last then if tv == "number" then if hexify then @@ -517,11 +631,7 @@ local function do_serialize(root,name,depth,level,indexed) handle(format("%s %s,",depth,v)) -- %.99g end elseif tv == "string" then - if reduce and tonumber(v) then - handle(format("%s %s,",depth,v)) - else - handle(format("%s %q,",depth,v)) - end + handle(format("%s %q,",depth,v)) elseif tv == "table" then if next(v) == nil then handle(format("%s {},",depth)) @@ -577,34 +687,18 @@ local function do_serialize(root,name,depth,level,indexed) end end elseif tv == "string" then - if reduce and tonumber(v) then - if tk == "number" then - if hexify then - handle(format("%s [0x%X]=%s,",depth,k,v)) - else - handle(format("%s [%s]=%s,",depth,k,v)) - end - elseif tk == "boolean" then - handle(format("%s [%s]=%s,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%s,",depth,k,v)) + if tk == "number" then + if hexify then + handle(format("%s [0x%X]=%q,",depth,k,v)) else - handle(format("%s [%q]=%s,",depth,k,v)) + handle(format("%s [%s]=%q,",depth,k,v)) end + elseif tk == "boolean" then + handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) + elseif noquotes and not reserved[k] and lpegmatch(propername,k) then + handle(format("%s %s=%q,",depth,k,v)) else - if tk == "number" then - if hexify then - handle(format("%s [0x%X]=%q,",depth,k,v)) - else - handle(format("%s [%s]=%q,",depth,k,v)) - end - elseif tk == "boolean" then - handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%q,",depth,k,v)) - else - handle(format("%s [%q]=%q,",depth,k,v)) - end + handle(format("%s [%q]=%q,",depth,k,v)) end elseif tv == "table" then if next(v) == nil then @@ -690,7 +784,6 @@ local function do_serialize(root,name,depth,level,indexed) handle(format("%s [%q]=%q,",depth,k,tostring(v))) end end - --~ end end end if level > 0 then @@ -707,7 +800,6 @@ local function serialize(_handle,root,name,specification) -- handle wins noquotes = specification.noquotes hexify = specification.hexify handle = _handle or specification.handle or print - reduce = specification.reduce or false functions = specification.functions compact = specification.compact inline = specification.inline and compact @@ -724,7 +816,6 @@ local function serialize(_handle,root,name,specification) -- handle wins noquotes = false hexify = false handle = _handle or print - reduce = false compact = true inline = true functions = true @@ -798,15 +889,6 @@ end table.tohandle = serialize --- sometimes tables are real use (zapfino extra pro is some 85M) in which --- case a stepwise serialization is nice; actually, we could consider: --- --- for line in table.serializer(root,name,reduce,noquotes) do --- ...(line) --- end --- --- so this is on the todo list - local maxtab = 2*1024 function table.tofile(filename,root,name,specification) diff --git a/Master/texmf-dist/tex/context/base/math-fen.mkiv b/Master/texmf-dist/tex/context/base/math-fen.mkiv index b2f64890c23..9570eac83b7 100644 --- a/Master/texmf-dist/tex/context/base/math-fen.mkiv +++ b/Master/texmf-dist/tex/context/base/math-fen.mkiv @@ -303,6 +303,10 @@ % \installmathfencepair { \Lbrace } \Rbrace % \installmathfencepair } \Rbracemirrored { \Lbracemirrored +\appendtoks + \ignorediscretionaries % so $\mtext{a|b}$ works, this is ok because it's an \hbox +\to \everymathematics + % todo paren parent \let\lbrack\lbracket diff --git a/Master/texmf-dist/tex/context/base/math-ini.mkiv b/Master/texmf-dist/tex/context/base/math-ini.mkiv index 79c9a62043d..83c7554ebba 100644 --- a/Master/texmf-dist/tex/context/base/math-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/math-ini.mkiv @@ -842,13 +842,6 @@ % \activatemathcharacter\primeasciicode -% not needed: -% -% \activatemathcharacter\barasciicode -% \appendtoks -% \let |\letterbar -% \to \everymathematics - % not used: % % \mathcode\spaceasciicode\activemathcharcode diff --git a/Master/texmf-dist/tex/context/base/publ-imp-apa.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-apa.mkvi index cf35a4b809e..9ab624bf82b 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-apa.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-apa.mkvi @@ -101,22 +101,28 @@ \definebtx [apa:\s!list:numbering] [apa:\s!list] + [\c!right={\space}] + +\definebtx + [apa:\s!list:numbering:default] + [apa:\s!list:numbering] \definebtx [apa:\s!list:numbering:num] [apa:\s!list:numbering] - [\c!stopper={.}, - \c!right={\space}] + [\c!stopper={.}] \definebtx [apa:\s!list:numbering:short] - [apa:\s!list:numbering:num] - [\c!stopper=] + [apa:\s!list:numbering] \definebtx [apa:\s!list:numbering:tag] - [apa:\s!list:numbering:num] - [\c!stopper=] + [apa:\s!list:numbering] + +\definebtx + [apa:\s!list:numbering:index] + [apa:\s!list:numbering] % Next, we define a namespace for each category diff --git a/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi index 9772fbb8751..28af82e748b 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi @@ -93,20 +93,28 @@ \definebtx [aps:\s!list:numbering] [aps:\s!list] + [left={[}, + right={]}] + +\definebtx + [aps:\s!list:numbering:default] + [aps:\s!list:numbering] \definebtx [aps:\s!list:numbering:num] [aps:\s!list:numbering] - [left={[}, - right={]}] \definebtx [aps:\s!list:numbering:short] - [aps:\s!list:numbering:num] + [aps:\s!list:numbering] \definebtx [aps:\s!list:numbering:tag] - [aps:\s!list:numbering:num] + [aps:\s!list:numbering] + +\definebtx + [aps:\s!list:numbering:index] + [aps:\s!list:numbering] %D In order to be able to get journals expanded (or normalized or abbreviated) you need %D to load a list: diff --git a/Master/texmf-dist/tex/context/base/publ-imp-default.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-default.mkvi index 73520c7ffd1..c7c88d74a58 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-default.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-default.mkvi @@ -61,6 +61,10 @@ [\s!default:\s!list:numbering] [\s!default:\s!list] +\definebtx + [\s!default:\s!list:numbering:default] + [\s!default:\s!list:numbering] + \definebtx [\s!default:\s!list:numbering:num] [\s!default:\s!list:numbering] @@ -73,6 +77,10 @@ [\s!default:\s!list:numbering:tag] [\s!default:\s!list:numbering:num] +\definebtx + [\s!default:\s!list:numbering:index] + [\s!default:\s!list:numbering:num] + \definebtx [\s!default:\s!list:author] [\s!default:\s!list] diff --git a/Master/texmf-dist/tex/context/base/publ-imp-list.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-list.mkvi index d34e4bc24c9..23256de333c 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-list.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-list.mkvi @@ -50,6 +50,16 @@ } \stopsetups +% Hans: can the following setups be condensed to one using some variable? + +\startsetups[\s!btx:\s!list:\s!numbering:default] + \btxstartstyleandcolor [\currentbtxspecification:\s!list:\s!numbering:default] + \btxusecommand[\currentbtxspecification:\s!list:\s!numbering:default] { + \fastsetup{\s!btx:\s!list:\s!numbering} + } + \btxstopstyleandcolor +\stopsetups + \startsetups[\s!btx:\s!list:\s!numbering:num] \btxstartstyleandcolor [\currentbtxspecification:\s!list:\s!numbering:num] \btxusecommand[\currentbtxspecification:\s!list:\s!numbering:num] { @@ -58,10 +68,6 @@ \btxstopstyleandcolor \stopsetups -\startsetups[\s!btx:\s!list:\s!numbering:\v!yes] - \fastsetup{\s!btx:\s!list:\s!numbering:num} -\stopsetups - \startsetups[\s!btx:\s!list:\s!numbering:short] \btxstartstyleandcolor [\currentbtxspecification:\s!list:\s!numbering:short] \btxusecommand [\currentbtxspecification:\s!list:\s!numbering:short] { @@ -79,4 +85,12 @@ \btxstopstyleandcolor \stopsetups +\startsetups[\s!btx:\s!list:\s!numbering:index] + \btxstartstyleandcolor [\currentbtxspecification:\s!list:\s!numbering:index] + \btxusecommand [\currentbtxspecification:\s!list:\s!numbering:index] { + \fastsetup{\s!btx:\s!list:\s!numbering} + } + \btxstopstyleandcolor +\stopsetups + \protect diff --git a/Master/texmf-dist/tex/context/base/publ-ini.lua b/Master/texmf-dist/tex/context/base/publ-ini.lua index 4f7dd44130a..34eeaec1882 100644 --- a/Master/texmf-dist/tex/context/base/publ-ini.lua +++ b/Master/texmf-dist/tex/context/base/publ-ini.lua @@ -3202,7 +3202,16 @@ do ctx_btxnumberingsetup(variant or "num") end - listvariants[v_yes] = listvariants.num + -- listvariants[v_yes] = listvariants.num + + function listvariants.index(dataset,block,tag,variant,listindex) + local index = getdetail(dataset,tag,"index") + ctx_btxsetfirst(index or "?") + if trace_detail then + report("expanding %a list setup %a","index",variant) + end + ctx_btxnumberingsetup(variant or "index") + end function listvariants.tag(dataset,block,tag,variant,listindex) ctx_btxsetfirst(tag) diff --git a/Master/texmf-dist/tex/context/base/publ-ini.mkiv b/Master/texmf-dist/tex/context/base/publ-ini.mkiv index 2d55832f9c2..233734bb610 100644 --- a/Master/texmf-dist/tex/context/base/publ-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/publ-ini.mkiv @@ -1658,7 +1658,7 @@ \clf_btxtoregister{\currentbtxdataset}{\currentbtxtag}% \to \t_btx_reference_inject -\unexpanded\def\btxindexedauthor#1#2#3#4#5#6% alternative von last first junior +\unexpanded\def\btxindexedauthor#1#2#3#4#5#6% alternative von last initials first junior {\begingroup \def\currentbtxcitealternative{#1}% \ifx\currentbtxcitealternative\empty @@ -1675,6 +1675,16 @@ \fastsetup{\s!btx:\s!cite:\s!author:\currentbtxcitealternative}% \endgroup} +\unexpanded\def\btxregisterauthor + {\doifelsenextoptionalcs\publ_register_author_yes\publ_register_author_nop} + +\def\publ_register_author_yes[#1]#2% + {\clf_btxauthortoregister{#1}{#2}\relax} + +\def\publ_register_author_nop#1% + {\clf_btxauthortoregister{\currentbtxdataset}{#1}\relax} + + %D We hook some setters in the definition sets: % \installdefinitionsetmember \??btx {btxspecification} \??btxcitevariant {btxcitevariant} diff --git a/Master/texmf-dist/tex/context/base/publ-reg.lua b/Master/texmf-dist/tex/context/base/publ-reg.lua index 39469e510db..3f276b49abc 100644 --- a/Master/texmf-dist/tex/context/base/publ-reg.lua +++ b/Master/texmf-dist/tex/context/base/publ-reg.lua @@ -153,6 +153,9 @@ local shorts = { } function flushers.author(step,field,value) + if type(value) == "string" then + value = publications.authorcache[value] + end if type(value) == "table" and #value > 0 then local register = step.register local processor = step.processor @@ -160,7 +163,7 @@ function flushers.author(step,field,value) for i=1,#value do local a = value[i] local k = writers[field] { a } - local e = f_author(alternative,components(a,short)) + local e = f_author(alternative,components(a)) ctx_dosetfastregisterentry(register,e,k,processor or "","") end end @@ -175,3 +178,50 @@ function flushers.keyword(step,field,value) end end end + +-- publications.registerflushers = flushers + +local function btxtoregister(dataset,tag) + local current = datasets[dataset] + for i=1,#sequence do + local step = sequence[i] + local dset = step.dataset + if dset == v_all or dset == dataset then + local done = step.done + if not done[tag] then + local value, field, kind = getcasted(current,tag,step.field,specifications[step.specification]) + if value then + flushers[kind](step,field,value) + end + done[tag] = true + end + end + end +end + +local function authortoregister(dataset,hash) + local author = publications.authorcache[hash] + if author then + local current = datasets[dataset] + for i=1,#sequence do + local step = sequence[i] + local dset = step.dataset + if dset == v_all or dset == dataset then + local register = step.register + local processor = step.processor + local alternative = shorts[step.alternative or "invertedshort"] or "invertedshort" + local k = writers.author { author } + local e = f_author(alternative,components(author,short)) + ctx_dosetfastregisterentry(register,e,k,processor or "","") + end + end + end +end + +publications.authortoregister = authortoregister + +implement { + name = "btxauthortoregister", + actions = authortoregister, + arguments = { "string", "string" } +} diff --git a/Master/texmf-dist/tex/context/base/publ-tra.lua b/Master/texmf-dist/tex/context/base/publ-tra.lua index b90455aed02..4b03307acc2 100644 --- a/Master/texmf-dist/tex/context/base/publ-tra.lua +++ b/Master/texmf-dist/tex/context/base/publ-tra.lua @@ -471,10 +471,34 @@ function tracers.showvariants(dataset,pages) end end +function tracers.showhashedauthors(dataset,pages) + local components = publications.components.author + ctx_starttabulate { "|T|T|T|T|T|T|" } + ctx_NC() ctx_bold("hash") + ctx_NC() ctx_bold("vons") + ctx_NC() ctx_bold("surnames") + ctx_NC() ctx_bold("initials") + ctx_NC() ctx_bold("firstnames") + ctx_NC() ctx_bold("juniors") + ctx_NC() ctx_NR() ctx_HL() + for hash, data in sortedhash(publications.authorcache) do + local vons, surnames, initials, firstnames, juniors = components(data) + ctx_NC() context(hash) + ctx_NC() context(vons) + ctx_NC() context(surnames) + ctx_NC() context(initials) + ctx_NC() context(firstnames) + ctx_NC() context(juniors) + ctx_NC() ctx_NR() + end + ctx_stoptabulate() +end + commands.showbtxdatasetfields = tracers.showdatasetfields commands.showbtxdatasetcompleteness = tracers.showdatasetcompleteness commands.showbtxfields = tracers.showfields commands.showbtxtables = tracers.showtables commands.showbtxdatasetauthors = tracers.showdatasetauthors +commands.showbtxhashedauthors = tracers.showhashedauthors commands.showbtxentry = tracers.showentry commands.showbtxvariants = tracers.showvariants diff --git a/Master/texmf-dist/tex/context/base/publ-tra.mkiv b/Master/texmf-dist/tex/context/base/publ-tra.mkiv index 2f86a5624fc..6ef86ca5944 100644 --- a/Master/texmf-dist/tex/context/base/publ-tra.mkiv +++ b/Master/texmf-dist/tex/context/base/publ-tra.mkiv @@ -23,6 +23,7 @@ \unexpanded\def\showbtxdatasetfields {\dosingleempty\publ_show_dataset_fields} \unexpanded\def\showbtxdatasetcompleteness{\dosingleempty\publ_show_dataset_completeness} \unexpanded\def\showbtxdatasetauthors {\dosingleempty\publ_show_dataset_authors} +\unexpanded\def\showbtxhashedauthors {\dosingleempty\publ_show_hashed_authors} \unexpanded\def\showbtxfields {\dosingleempty\publ_show_fields} \unexpanded\def\showbtxtables {\dosingleempty\publ_show_tables} @@ -69,6 +70,9 @@ \ctxcommand{showbtxtables{}}% \endgroup} +\def\publ_show_hashed_authors[#1]% + {\ctxcommand{showbtxhashedauthors{}}} + \protect \continueifinputfile{publ-tra.mkiv} diff --git a/Master/texmf-dist/tex/context/base/status-files.pdf b/Master/texmf-dist/tex/context/base/status-files.pdf index 78e8b3da7bf..e43651ef87a 100644 Binary files a/Master/texmf-dist/tex/context/base/status-files.pdf and b/Master/texmf-dist/tex/context/base/status-files.pdf differ diff --git a/Master/texmf-dist/tex/context/base/status-lua.pdf b/Master/texmf-dist/tex/context/base/status-lua.pdf index 2db0c34065a..37e62b70be0 100644 Binary files a/Master/texmf-dist/tex/context/base/status-lua.pdf and b/Master/texmf-dist/tex/context/base/status-lua.pdf differ diff --git a/Master/texmf-dist/tex/context/base/typo-itc.lua b/Master/texmf-dist/tex/context/base/typo-itc.lua index c6528eee8b8..d3a31fad1bf 100644 --- a/Master/texmf-dist/tex/context/base/typo-itc.lua +++ b/Master/texmf-dist/tex/context/base/typo-itc.lua @@ -39,6 +39,7 @@ local getfont = nuts.getfont local getchar = nuts.getchar local getattr = nuts.getattr local setattr = nuts.setattr +local setfield = nuts.setfield local insert_node_after = nuts.insert_after local delete_node = nuts.delete @@ -132,14 +133,6 @@ end -- return with_attributes(new_correction_kern(kern),n) -- end -local function correction_glue(glue,n) - local g = new_correction_glue(glue) - if n then - setfield(g,"attr",getfield(n,"attr")) - end - return g -end - local function correction_kern(kern,n) local k = new_correction_kern(kern) if n then @@ -151,7 +144,7 @@ local function correction_kern(kern,n) return k end -local function correction_glue(n,glue) +local function correction_glue(glue,n) local g = new_correction_glue(glue) if n then local a = getfield(n,"attr") diff --git a/Master/texmf-dist/tex/context/base/typo-sus.lua b/Master/texmf-dist/tex/context/base/typo-sus.lua index 9eef6196bb0..0fe8e143adc 100644 --- a/Master/texmf-dist/tex/context/base/typo-sus.lua +++ b/Master/texmf-dist/tex/context/base/typo-sus.lua @@ -20,6 +20,11 @@ local closequote = { pf = true, } +local weird = { + lm = true, + no = true, +} + local categories = characters.categories local nodecodes = nodes.nodecodes @@ -187,6 +192,8 @@ function typesetters.marksuspects(head) if prev and pid == glue_code then done = 1 -- darkred end + elseif weird[code] then + done = 2 -- darkgreen else local prev, pid = goback(current) if prev then diff --git a/Master/texmf-dist/tex/context/base/util-prs.lua b/Master/texmf-dist/tex/context/base/util-prs.lua index ea34c2c279d..a3c1c6f8f23 100644 --- a/Master/texmf-dist/tex/context/base/util-prs.lua +++ b/Master/texmf-dist/tex/context/base/util-prs.lua @@ -21,6 +21,8 @@ parsers.patterns = patterns local setmetatableindex = table.setmetatableindex local sortedhash = table.sortedhash +local sortedkeys = table.sortedkeys +local tohash = table.tohash -- we share some patterns @@ -94,9 +96,7 @@ patterns.settings_to_hash_b = pattern_b_s patterns.settings_to_hash_c = pattern_c_s function parsers.make_settings_to_hash_pattern(set,how) - if type(str) == "table" then - return set - elseif how == "strict" then + if how == "strict" then return (pattern_c/set)^1 elseif how == "tolerant" then return (pattern_b/set)^1 @@ -106,7 +106,9 @@ function parsers.make_settings_to_hash_pattern(set,how) end function parsers.settings_to_hash(str,existing) - if type(str) == "table" then + if not str or str == "" then + return { } + elseif type(str) == "table" then if existing then for k, v in next, str do existing[k] = v @@ -115,17 +117,17 @@ function parsers.settings_to_hash(str,existing) else return str end - elseif str and str ~= "" then + else hash = existing or { } lpegmatch(pattern_a_s,str) return hash - else - return { } end end function parsers.settings_to_hash_tolerant(str,existing) - if type(str) == "table" then + if not str or str == "" then + return { } + elseif type(str) == "table" then if existing then for k, v in next, str do existing[k] = v @@ -134,17 +136,17 @@ function parsers.settings_to_hash_tolerant(str,existing) else return str end - elseif str and str ~= "" then + else hash = existing or { } lpegmatch(pattern_b_s,str) return hash - else - return { } end end function parsers.settings_to_hash_strict(str,existing) - if type(str) == "table" then + if not str or str == "" then + return nil + elseif type(str) == "table" then if existing then for k, v in next, str do existing[k] = v @@ -157,8 +159,6 @@ function parsers.settings_to_hash_strict(str,existing) hash = existing or { } lpegmatch(pattern_c_s,str) return next(hash) and hash - else - return nil end end @@ -174,10 +174,10 @@ patterns.settings_to_array = pattern -- we could use a weak table as cache function parsers.settings_to_array(str,strict) - if type(str) == "table" then - return str - elseif not str or str == "" then + if not str or str == "" then return { } + elseif type(str) == "table" then + return str elseif strict then if find(str,"{",1,true) then return lpegmatch(pattern,str) @@ -262,8 +262,8 @@ end function parsers.hash_to_string(h,separator,yes,no,strict,omit) if h then - local t, tn, s = { }, 0, table.sortedkeys(h) - omit = omit and table.tohash(omit) + local t, tn, s = { }, 0, sortedkeys(h) + omit = omit and tohash(omit) for i=1,#s do local key = s[i] if not omit or not omit[key] then @@ -478,7 +478,7 @@ local defaultspecification = { separator = ",", quote = '"' } -- database module function parsers.csvsplitter(specification) - specification = specification and table.setmetatableindex(specification,defaultspecification) or defaultspecification + specification = specification and setmetatableindex(specification,defaultspecification) or defaultspecification local separator = specification.separator local quotechar = specification.quote local separator = S(separator ~= "" and separator or ",") @@ -517,7 +517,7 @@ end -- local list, names = mycsvsplitter(crap) inspect(list) inspect(names) function parsers.rfc4180splitter(specification) - specification = specification and table.setmetatableindex(specification,defaultspecification) or defaultspecification + specification = specification and setmetatableindex(specification,defaultspecification) or defaultspecification local separator = specification.separator --> rfc: COMMA local quotechar = P(specification.quote) --> DQUOTE local dquotechar = quotechar * quotechar --> 2DQUOTE @@ -602,10 +602,10 @@ end -- print(utilities.parsers.unittotex("10^-32 %"),utilities.parsers.unittoxml("10^32 %")) local cache = { } -local spaces = lpeg.patterns.space^0 +local spaces = lpegpatterns.space^0 local dummy = function() end -table.setmetatableindex(cache,function(t,k) +setmetatableindex(cache,function(t,k) local separator = P(k) local value = (1-separator)^0 local pattern = spaces * C(value) * separator^0 * Cp() diff --git a/Master/texmf-dist/tex/context/base/util-tab.lua b/Master/texmf-dist/tex/context/base/util-tab.lua index 5eae0d5f676..618f34ceef8 100644 --- a/Master/texmf-dist/tex/context/base/util-tab.lua +++ b/Master/texmf-dist/tex/context/base/util-tab.lua @@ -11,7 +11,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 = table.concat, table.insert, table.remove +local concat, insert, remove, sort = table.concat, table.insert, table.remove, table.sort local setmetatable, getmetatable, tonumber, tostring = setmetatable, getmetatable, tonumber, tostring 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 @@ -571,8 +571,42 @@ function table.serialize(root,name,specification) local t -- = { } local n = 1 +-- local function simple_table(t) +-- local ts = #t +-- if ts > 0 then +-- local n = 0 +-- for _, v in next, t do +-- n = n + 1 +-- if type(v) == "table" then +-- return nil +-- end +-- end +-- if n == ts then +-- local tt = { } +-- local nt = 0 +-- for i=1,ts do +-- local v = t[i] +-- local tv = type(v) +-- nt = nt + 1 +-- if tv == "number" then +-- tt[nt] = v +-- elseif tv == "string" then +-- tt[nt] = format("%q",v) -- f_string(v) +-- elseif tv == "boolean" then +-- tt[nt] = v and "true" or "false" +-- else +-- return nil +-- end +-- end +-- return tt +-- end +-- end +-- return nil +-- end + local function simple_table(t) - if #t > 0 then + local nt = #t + if nt > 0 then local n = 0 for _, v in next, t do n = n + 1 @@ -580,19 +614,17 @@ function table.serialize(root,name,specification) return nil end end - if n == #t then + if n == nt then local tt = { } - local nt = 0 - for i=1,#t do + for i=1,nt do local v = t[i] local tv = type(v) - nt = nt + 1 if tv == "number" then - tt[nt] = v + tt[i] = v -- not needed tostring(v) elseif tv == "string" then - tt[nt] = format("%q",v) -- f_string(v) + tt[i] = format("%q",v) -- f_string(v) elseif tv == "boolean" then - tt[nt] = v and "true" or "false" + tt[i] = v and "true" or "false" else return nil end @@ -636,13 +668,13 @@ function table.serialize(root,name,specification) if last > 0 then first = 1 end - local sk = sortedkeys(root) -- inline fast version? + local sk = sortedkeys(root) -- inline fast version?\ for i=1,#sk do local k = sk[i] local v = root[k] local tv = type(v) local tk = type(k) - if first and tk == "number" and k >= first and k <= last then + if first and tk == "number" and k <= last and k >= first then if tv == "number" then n = n + 1 t[n] = f_val_num(depth,v) elseif tv == "string" then @@ -680,11 +712,11 @@ function table.serialize(root,name,specification) elseif tv == "table" then if next(v) == nil then if tk == "number" then - n = n + 1 t[n] = f_key_num_value_not(depth,k,v) + n = n + 1 t[n] = f_key_num_value_not(depth,k) elseif tk == "string" then - n = n + 1 t[n] = f_key_str_value_not(depth,k,v) + n = n + 1 t[n] = f_key_str_value_not(depth,k) elseif tk == "boolean" then - n = n + 1 t[n] = f_key_boo_value_not(depth,k,v) + n = n + 1 t[n] = f_key_boo_value_not(depth,k) end else local st = simple_table(v) diff --git a/Master/texmf-dist/tex/context/base/x-asciimath.lua b/Master/texmf-dist/tex/context/base/x-asciimath.lua index efa6a7736d6..51f401e6640 100644 --- a/Master/texmf-dist/tex/context/base/x-asciimath.lua +++ b/Master/texmf-dist/tex/context/base/x-asciimath.lua @@ -1817,7 +1817,7 @@ local uncrapped = { ["_"] = "\\underline{\\enspace}", } -local function convert(str) +local function convert(str,nowrap) if #str > 0 then local unicoded = lpegmatch(u_parser,str) or str if lpegmatch(p_onechar,unicoded) then @@ -1834,6 +1834,8 @@ local function convert(str) if message then report_asciimath("%s: %s : %s",message,str,texcoded) ctx_type(formatters["<%s>"](message)) + elseif nowrap then + context(texcoded) else ctx_mathematics(texcoded) end @@ -1936,11 +1938,17 @@ if not context then end interfaces.implement { - name = "asciimath", -- module_asciimath_convert + name = "asciimath", actions = convert, arguments = "string" } +interfaces.implement { + name = "justasciimath", + actions = convert, + arguments = { "string", true }, +} + local ctx_typebuffer = context.typebuffer local ctx_mathematics = context.mathematics local ctx_color = context.color diff --git a/Master/texmf-dist/tex/context/base/x-asciimath.mkiv b/Master/texmf-dist/tex/context/base/x-asciimath.mkiv index cc98b54acca..1d62fb93d32 100644 --- a/Master/texmf-dist/tex/context/base/x-asciimath.mkiv +++ b/Master/texmf-dist/tex/context/base/x-asciimath.mkiv @@ -156,8 +156,20 @@ }}% \to \everysetupasciimath -\unexpanded\def\asciimath#1% - {\clf_asciimath{\detokenize\expandafter{\normalexpanded{#1}}}} +\newtoks\everyascimath + +% \appendtoks +% \ignorediscretionaries +% \to \everyasciimath + +\unexpanded\def\asciimath + {\doifnextoptionalelse\asciimath_yes\asciimath_nop} + +\def\asciimath_yes[#1]#2% + {\mathematics[#1]{\clf_justasciimath{\detokenize\expandafter{\normalexpanded{#2}}}}} + +\def\asciimath_nop#1% + {\mathematics{\clf_justasciimath{\detokenize\expandafter{\normalexpanded{#1}}}}} \unexpanded\def\ctxmoduleasciimath#1% {\ctxlua{moduledata.asciimath.#1}} diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua index 0e0e5ebba0e..81883b8b8fc 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/Master/texmf-dist/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 : 05/13/15 23:52:22 +-- merge date : 05/15/15 23:03:46 do -- begin closure to overcome local limits and interference @@ -1041,7 +1041,7 @@ end function table.keys(t) if t then local keys,k={},0 - for key,_ in next,t do + for key in next,t do k=k+1 keys[k]=key end @@ -1052,32 +1052,51 @@ function table.keys(t) end local function compare(a,b) local ta=type(a) - local tb=type(b) - if ta==tb and ta=="number" then - return a1 then + sort(srt) + end return srt else return {} @@ -1105,13 +1126,15 @@ end local function sortedindexonly(tab) if tab then local srt,s={},0 - for key,_ in next,tab do + for key in next,tab do if type(key)=="number" then s=s+1 srt[s]=key end end - sort(srt) + if s>1 then + sort(srt) + end return srt else return {} @@ -1120,13 +1143,15 @@ end local function sortedhashkeys(tab,cmp) if tab then local srt,s={},0 - for key,_ in next,tab do + for key in next,tab do if key then s=s+1 srt[s]=key end end - sort(srt,cmp) + if s>1 then + sort(srt,cmp) + end return srt else return {} @@ -1135,7 +1160,7 @@ end function table.allkeys(t) local keys={} for k,v in next,t do - for k,v in next,v do + for k in next,v do keys[k]=true end end @@ -1154,19 +1179,21 @@ local function sortedhash(t,cmp) else s=sortedkeys(t) end - local n=0 local m=#s - local function kv() - if n0 then + local n=0 + return function() + if n0 then + local nt=#t + if nt>0 then local n=0 for _,v in next,t do n=n+1 end - if n==#t then - local tt,nt={},0 - for i=1,#t do + if n==nt then + local tt={} + for i=1,nt do local v=t[i] local tv=type(v) if tv=="number" then - nt=nt+1 if hexify then - tt[nt]=format("0x%X",v) + tt[i]=format("0x%X",v) else - tt[nt]=tostring(v) + tt[i]=tostring(v) end elseif tv=="string" then - nt=nt+1 - tt[nt]=format("%q",v) + tt[i]=format("%q",v) elseif tv=="boolean" then - nt=nt+1 - tt[nt]=v and "true" or "false" + tt[i]=v and "true" or "false" else - tt=nil - break + return nil end end return tt @@ -1394,7 +1418,8 @@ local function do_serialize(root,name,depth,level,indexed) for i=1,#sk do local k=sk[i] local v=root[k] - local tv,tk=type(v),type(k) + local tv=type(v) + local tk=type(k) if compact and first and tk=="number" and k>=first and k<=last then if tv=="number" then if hexify then @@ -1403,11 +1428,7 @@ local function do_serialize(root,name,depth,level,indexed) handle(format("%s %s,",depth,v)) end elseif tv=="string" then - if reduce and tonumber(v) then - handle(format("%s %s,",depth,v)) - else - handle(format("%s %q,",depth,v)) - end + handle(format("%s %q,",depth,v)) elseif tv=="table" then if next(v)==nil then handle(format("%s {},",depth)) @@ -1463,34 +1484,18 @@ local function do_serialize(root,name,depth,level,indexed) end end elseif tv=="string" then - if reduce and tonumber(v) then - if tk=="number" then - if hexify then - handle(format("%s [0x%X]=%s,",depth,k,v)) - else - handle(format("%s [%s]=%s,",depth,k,v)) - end - elseif tk=="boolean" then - handle(format("%s [%s]=%s,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%s,",depth,k,v)) + if tk=="number" then + if hexify then + handle(format("%s [0x%X]=%q,",depth,k,v)) else - handle(format("%s [%q]=%s,",depth,k,v)) + handle(format("%s [%s]=%q,",depth,k,v)) end + elseif tk=="boolean" then + handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) + elseif noquotes and not reserved[k] and lpegmatch(propername,k) then + handle(format("%s %s=%q,",depth,k,v)) else - if tk=="number" then - if hexify then - handle(format("%s [0x%X]=%q,",depth,k,v)) - else - handle(format("%s [%s]=%q,",depth,k,v)) - end - elseif tk=="boolean" then - handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) - elseif noquotes and not reserved[k] and lpegmatch(propername,k) then - handle(format("%s %s=%q,",depth,k,v)) - else - handle(format("%s [%q]=%q,",depth,k,v)) - end + handle(format("%s [%q]=%q,",depth,k,v)) end elseif tv=="table" then if next(v)==nil then @@ -1587,7 +1592,6 @@ local function serialize(_handle,root,name,specification) noquotes=specification.noquotes hexify=specification.hexify handle=_handle or specification.handle or print - reduce=specification.reduce or false functions=specification.functions compact=specification.compact inline=specification.inline and compact @@ -1604,7 +1608,6 @@ local function serialize(_handle,root,name,specification) noquotes=false hexify=false handle=_handle or print - reduce=false compact=true inline=true functions=true @@ -12719,15 +12722,8 @@ local function normal_handle_contextchain(head,start,kind,chainname,contexts,seq break end end - elseif f==2 then - match=seq[1][32] else - for n=f-1,1 do - if not seq[n][32] then - match=false - break - end - end + match=false end end if match and s>l then @@ -12777,15 +12773,8 @@ local function normal_handle_contextchain(head,start,kind,chainname,contexts,seq break end end - elseif s-l==1 then - match=seq[s][32] else - for n=l+1,s do - if not seq[n][32] then - match=false - break - end - end + match=false end end end diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-otn.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-otn.lua index 343e1826e0f..dd3aa61530d 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-otn.lua +++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-otn.lua @@ -376,7 +376,7 @@ local function copy_glyph(g) -- next and prev are untouched ! end end --- +-- -- start is a mark and we need to keep that one @@ -1834,15 +1834,8 @@ local function normal_handle_contextchain(head,start,kind,chainname,contexts,seq break end end - elseif f == 2 then - match = seq[1][32] else - for n=f-1,1 do - if not seq[n][32] then - match = false - break - end - end + match = false end end -- after @@ -1895,15 +1888,8 @@ local function normal_handle_contextchain(head,start,kind,chainname,contexts,seq break end end - elseif s-l == 1 then - match = seq[s][32] else - for n=l+1,s do - if not seq[n][32] then - match = false - break - end - end + match = false end end end diff --git a/Master/tlpkg/bin/tl-update-bindir b/Master/tlpkg/bin/tl-update-bindir index 3cae36d6ebb..49155c92eda 100755 --- a/Master/tlpkg/bin/tl-update-bindir +++ b/Master/tlpkg/bin/tl-update-bindir @@ -163,8 +163,7 @@ for tlname in $tlnames; do grab="$download -O $download_loc" $grab http://www.solid.ethz.ch/download/texlive/texlive-mips-irix.tar.xz;; mipsel-linux) - default_bin_loc=$download_loc - $grab http://www.mojca.si/tl/mipsel-linux.tar.gz;; + echo "see mojca" >&2; exit 1;; powerpc-linux) default_bin_loc=/home/tschmitz/powerpc-linux.tar.xz;; sparc-linux) diff --git a/Master/tlpkg/bin/tlpkginfo b/Master/tlpkg/bin/tlpkginfo index be921baafaf..9723cc58433 100755 --- a/Master/tlpkg/bin/tlpkginfo +++ b/Master/tlpkg/bin/tlpkginfo @@ -368,7 +368,7 @@ sub prepare { # ...and except for context, and plenty more... } elsif ($pkg eq "context") { - $tds_path = "/home/ftp/mirror/www.pragma-ade.com/context/beta/cont-tmf.zip"; + $tds_path = "/home/ftp/mirror/www.pragma-ade.com/context/current/cont-tmf.zip"; } elsif ($pkg eq "enctex") { # not tds, but we eliminate the TDS_READY below -- cgit v1.2.3