From 898d8e12e219efa15e367285cee56cab77f84339 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 4 Aug 2021 18:47:30 +0200 Subject: 2021-08-04 17:50:00 --- scripts/context/lua/mtx-context.lua | 2 +- scripts/context/lua/mtxrun.lua | 27 +++++++++++++++++++-------- scripts/context/stubs/mswin/mtxrun.lua | 27 +++++++++++++++++++-------- scripts/context/stubs/unix/mtxrun | 27 +++++++++++++++++++-------- scripts/context/stubs/win64/mtxrun.lua | 27 +++++++++++++++++++-------- 5 files changed, 77 insertions(+), 33 deletions(-) (limited to 'scripts') diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index 963afcec9..505f63b17 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -868,7 +868,7 @@ function scripts.context.run(ctxdata,filename) -- local usedname = jobname local engine = analysis.engine or "luametatex" - if lmtx and (mainfile == usedfiles.yes or mainfile == usedfiles.nop) and not getargument("redirected") then + if engine == "luametatex" and (mainfile == usedfiles.yes or mainfile == usedfiles.nop) and not getargument("redirected") then mainfile = "" -- we don't need that usedname = fulljobname end diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index e35763c09..1f85f9fe7 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -3285,7 +3285,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-io"] = package.loaded["l-io"] or true --- original size: 11829, stripped down to: 6331 +-- original size: 11951, stripped down to: 6430 if not modules then modules={} end modules ['l-io']={ version=1.001, @@ -3352,9 +3352,12 @@ function io.copydata(source,target,action) flush() end end -function io.savedata(filename,data,joiner) - local f=open(filename,"wb") +function io.savedata(filename,data,joiner,append) + local f=open(filename,append and "ab" or "wb") if f then + if append and joiner and f:seek("end")>0 then + f:write(joiner) + end if type(data)=="table" then f:write(concat(data,joiner or "")) elseif type(data)=="function" then @@ -6522,7 +6525,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 45129, stripped down to: 23525 +-- original size: 45866, stripped down to: 23846 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6534,7 +6537,7 @@ if not modules then modules={} end modules ['util-str']={ utilities=utilities or {} utilities.strings=utilities.strings or {} local strings=utilities.strings -local format,gsub,rep,sub,find=string.format,string.gsub,string.rep,string.sub,string.find +local format,gsub,rep,sub,find,char=string.format,string.gsub,string.rep,string.sub,string.find,string.char local load,dump=load,string.dump local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable local unpack,concat=table.unpack,table.concat @@ -6887,12 +6890,20 @@ local template=[[ return function(%s) return %s end ]] local pattern=Cs(Cc('"')*( - (1-S('"\\\n\r'))^1+P('"')/'\\"'+P('\\')/'\\\\'+P('\n')/'\\n'+P('\r')/'\\r' + (1-S('"\\\n\r'))^1+P('"')/'\\034'+P('\\')/'\\020'+P('\n')/'\\013'+P('\r')/'\\010' )^0*Cc('"')) patterns.escapedquotes=pattern function string.escapedquotes(s) return lpegmatch(pattern,s) end +local pattern=(1-P("\\"))^1;pattern=Cs ( + pattern*((P("\\")/""*(digit^-3/function(s) return char(tonumber(s)) end))+pattern )^1 +) +patterns.unescapedquotes=pattern +function string.unescapedquotes(s) + return lpegmatch(pattern,s) or s +end +string.texnewlines=lpeg.replacer(patterns.newline,"\r",true) local preamble="" local environment={ global=global or _G, @@ -25921,8 +25932,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.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 libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1025470 --- stripped bytes : 402390 +-- original bytes : 1026329 +-- stripped bytes : 402829 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index e35763c09..1f85f9fe7 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -3285,7 +3285,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-io"] = package.loaded["l-io"] or true --- original size: 11829, stripped down to: 6331 +-- original size: 11951, stripped down to: 6430 if not modules then modules={} end modules ['l-io']={ version=1.001, @@ -3352,9 +3352,12 @@ function io.copydata(source,target,action) flush() end end -function io.savedata(filename,data,joiner) - local f=open(filename,"wb") +function io.savedata(filename,data,joiner,append) + local f=open(filename,append and "ab" or "wb") if f then + if append and joiner and f:seek("end")>0 then + f:write(joiner) + end if type(data)=="table" then f:write(concat(data,joiner or "")) elseif type(data)=="function" then @@ -6522,7 +6525,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 45129, stripped down to: 23525 +-- original size: 45866, stripped down to: 23846 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6534,7 +6537,7 @@ if not modules then modules={} end modules ['util-str']={ utilities=utilities or {} utilities.strings=utilities.strings or {} local strings=utilities.strings -local format,gsub,rep,sub,find=string.format,string.gsub,string.rep,string.sub,string.find +local format,gsub,rep,sub,find,char=string.format,string.gsub,string.rep,string.sub,string.find,string.char local load,dump=load,string.dump local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable local unpack,concat=table.unpack,table.concat @@ -6887,12 +6890,20 @@ local template=[[ return function(%s) return %s end ]] local pattern=Cs(Cc('"')*( - (1-S('"\\\n\r'))^1+P('"')/'\\"'+P('\\')/'\\\\'+P('\n')/'\\n'+P('\r')/'\\r' + (1-S('"\\\n\r'))^1+P('"')/'\\034'+P('\\')/'\\020'+P('\n')/'\\013'+P('\r')/'\\010' )^0*Cc('"')) patterns.escapedquotes=pattern function string.escapedquotes(s) return lpegmatch(pattern,s) end +local pattern=(1-P("\\"))^1;pattern=Cs ( + pattern*((P("\\")/""*(digit^-3/function(s) return char(tonumber(s)) end))+pattern )^1 +) +patterns.unescapedquotes=pattern +function string.unescapedquotes(s) + return lpegmatch(pattern,s) or s +end +string.texnewlines=lpeg.replacer(patterns.newline,"\r",true) local preamble="" local environment={ global=global or _G, @@ -25921,8 +25932,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.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 libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1025470 --- stripped bytes : 402390 +-- original bytes : 1026329 +-- stripped bytes : 402829 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index e35763c09..1f85f9fe7 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -3285,7 +3285,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-io"] = package.loaded["l-io"] or true --- original size: 11829, stripped down to: 6331 +-- original size: 11951, stripped down to: 6430 if not modules then modules={} end modules ['l-io']={ version=1.001, @@ -3352,9 +3352,12 @@ function io.copydata(source,target,action) flush() end end -function io.savedata(filename,data,joiner) - local f=open(filename,"wb") +function io.savedata(filename,data,joiner,append) + local f=open(filename,append and "ab" or "wb") if f then + if append and joiner and f:seek("end")>0 then + f:write(joiner) + end if type(data)=="table" then f:write(concat(data,joiner or "")) elseif type(data)=="function" then @@ -6522,7 +6525,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 45129, stripped down to: 23525 +-- original size: 45866, stripped down to: 23846 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6534,7 +6537,7 @@ if not modules then modules={} end modules ['util-str']={ utilities=utilities or {} utilities.strings=utilities.strings or {} local strings=utilities.strings -local format,gsub,rep,sub,find=string.format,string.gsub,string.rep,string.sub,string.find +local format,gsub,rep,sub,find,char=string.format,string.gsub,string.rep,string.sub,string.find,string.char local load,dump=load,string.dump local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable local unpack,concat=table.unpack,table.concat @@ -6887,12 +6890,20 @@ local template=[[ return function(%s) return %s end ]] local pattern=Cs(Cc('"')*( - (1-S('"\\\n\r'))^1+P('"')/'\\"'+P('\\')/'\\\\'+P('\n')/'\\n'+P('\r')/'\\r' + (1-S('"\\\n\r'))^1+P('"')/'\\034'+P('\\')/'\\020'+P('\n')/'\\013'+P('\r')/'\\010' )^0*Cc('"')) patterns.escapedquotes=pattern function string.escapedquotes(s) return lpegmatch(pattern,s) end +local pattern=(1-P("\\"))^1;pattern=Cs ( + pattern*((P("\\")/""*(digit^-3/function(s) return char(tonumber(s)) end))+pattern )^1 +) +patterns.unescapedquotes=pattern +function string.unescapedquotes(s) + return lpegmatch(pattern,s) or s +end +string.texnewlines=lpeg.replacer(patterns.newline,"\r",true) local preamble="" local environment={ global=global or _G, @@ -25921,8 +25932,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.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 libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1025470 --- stripped bytes : 402390 +-- original bytes : 1026329 +-- stripped bytes : 402829 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index e35763c09..1f85f9fe7 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -3285,7 +3285,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-io"] = package.loaded["l-io"] or true --- original size: 11829, stripped down to: 6331 +-- original size: 11951, stripped down to: 6430 if not modules then modules={} end modules ['l-io']={ version=1.001, @@ -3352,9 +3352,12 @@ function io.copydata(source,target,action) flush() end end -function io.savedata(filename,data,joiner) - local f=open(filename,"wb") +function io.savedata(filename,data,joiner,append) + local f=open(filename,append and "ab" or "wb") if f then + if append and joiner and f:seek("end")>0 then + f:write(joiner) + end if type(data)=="table" then f:write(concat(data,joiner or "")) elseif type(data)=="function" then @@ -6522,7 +6525,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 45129, stripped down to: 23525 +-- original size: 45866, stripped down to: 23846 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6534,7 +6537,7 @@ if not modules then modules={} end modules ['util-str']={ utilities=utilities or {} utilities.strings=utilities.strings or {} local strings=utilities.strings -local format,gsub,rep,sub,find=string.format,string.gsub,string.rep,string.sub,string.find +local format,gsub,rep,sub,find,char=string.format,string.gsub,string.rep,string.sub,string.find,string.char local load,dump=load,string.dump local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable local unpack,concat=table.unpack,table.concat @@ -6887,12 +6890,20 @@ local template=[[ return function(%s) return %s end ]] local pattern=Cs(Cc('"')*( - (1-S('"\\\n\r'))^1+P('"')/'\\"'+P('\\')/'\\\\'+P('\n')/'\\n'+P('\r')/'\\r' + (1-S('"\\\n\r'))^1+P('"')/'\\034'+P('\\')/'\\020'+P('\n')/'\\013'+P('\r')/'\\010' )^0*Cc('"')) patterns.escapedquotes=pattern function string.escapedquotes(s) return lpegmatch(pattern,s) end +local pattern=(1-P("\\"))^1;pattern=Cs ( + pattern*((P("\\")/""*(digit^-3/function(s) return char(tonumber(s)) end))+pattern )^1 +) +patterns.unescapedquotes=pattern +function string.unescapedquotes(s) + return lpegmatch(pattern,s) or s +end +string.texnewlines=lpeg.replacer(patterns.newline,"\r",true) local preamble="" local environment={ global=global or _G, @@ -25921,8 +25932,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.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 libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1025470 --- stripped bytes : 402390 +-- original bytes : 1026329 +-- stripped bytes : 402829 -- end library merge -- cgit v1.2.3