summaryrefslogtreecommitdiff
path: root/scripts/context
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2015-12-17 16:15:07 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2015-12-17 16:15:07 +0100
commitd1faffcd5d92925a6c5e66ebb72b4c8dcfae236f (patch)
treec1663d54da8573c0541015e5a307a28e22215a8b /scripts/context
parentadc43c3c243ed95215af6fe02d71e393c178da23 (diff)
downloadcontext-d1faffcd5d92925a6c5e66ebb72b4c8dcfae236f.tar.gz
2015-12-17 15:59:00
Diffstat (limited to 'scripts/context')
-rw-r--r--scripts/context/lua/mtx-chars.lua178
-rw-r--r--scripts/context/lua/mtx-fonts.lua8
-rw-r--r--scripts/context/lua/mtx-package.lua2
-rw-r--r--scripts/context/lua/mtx-profile.lua17
-rw-r--r--scripts/context/lua/mtx-unicode.lua514
-rw-r--r--scripts/context/lua/mtxrun.lua29
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua29
-rw-r--r--scripts/context/stubs/unix/mtxrun29
-rw-r--r--scripts/context/stubs/win64/mtxrun.lua29
9 files changed, 661 insertions, 174 deletions
diff --git a/scripts/context/lua/mtx-chars.lua b/scripts/context/lua/mtx-chars.lua
index 9f6852da2..d54804a1b 100644
--- a/scripts/context/lua/mtx-chars.lua
+++ b/scripts/context/lua/mtx-chars.lua
@@ -36,85 +36,15 @@ local application = logs.application {
local report = application.report
-local format, gmatch, upper, lower = string.format, string.gmatch, string.upper, string.lower
-local tonumber = tonumber
+local format, gmatch, upper, lower, find = string.format, string.gmatch, string.upper, string.lower, string.find
+local formatters = string.formatters
+local tonumber, type = tonumber, type
local concat = table.concat
local utfchar = utf.char
scripts = scripts or { }
scripts.chars = scripts.chars or { }
---~ local banner = [[
---~ -- filename : char-mth.lua
---~ -- comment : companion to char-mth.tex (in ConTeXt)
---~ -- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
---~ -- license : see context related readme files
---~ -- comment : generated from data file downloaded from STIX website
---~
---~ if not versions then versions = { } end versions['char-mth'] = 1.001
---~ if not characters then characters = { } end
---~ ]]
---~
---~ function scripts.chars.stixtomkiv(inname,outname)
---~ if inname == "" then
---~ report("aquiring math data, invalid datafilename")
---~ end
---~ local f = io.open(inname)
---~ if not f then
---~ report("aquiring math data, invalid datafile")
---~ else
---~ report("aquiring math data, processing %s",inname)
---~ if not outname or outname == "" then
---~ outname = "char-mth.lua"
---~ end
---~ local classes = {
---~ N = "normal",
---~ A = "alphabetic",
---~ D = "diacritic",
---~ P = "punctuation",
---~ B = "binary",
---~ R = "relation",
---~ L = "large",
---~ O = "opening",
---~ C = "closing",
---~ F = "fence"
---~ }
---~ local valid, done = false, { }
---~ local g = io.open(outname,'w')
---~ g:write(banner)
---~ g:write(format("\ncharacters.math = {\n"))
---~ for l in f:lines() do
---~ if not valid then
---~ valid = l:find("AMS/TeX name")
---~ end
---~ if valid then
---~ local unicode = l:sub(2,6)
---~ if unicode:sub(1,1) ~= " " and unicode ~= "" and not done[unicode] then
---~ local mathclass, adobename, texname = l:sub(57,57) or "", l:sub(13,36) or "", l:sub(84,109) or ""
---~ texname, adobename = texname:gsub("[\\ ]",""), adobename:gsub("[\\ ]","")
---~ local t = { }
---~ if mathclass ~= "" then t[#t+1] = format("mathclass='%s'", classes[mathclass] or "unknown") end
---~ if adobename ~= "" then t[#t+1] = format("adobename='%s'", adobename ) end
---~ if texname ~= "" then t[#t+1] = format("texname='%s'" , texname ) end
---~ if #t > 0 then
---~ g:write(format("\t[0x%s] = { %s },\n",unicode, concat(t,", ")))
---~ end
---~ done[unicode] = true
---~ end
---~ end
---~ end
---~ if not valid then
---~ g:write("\t-- The data file is corrupt, invalid or maybe the format has changed.\n")
---~ report("aquiring math data, problems with data table")
---~ else
---~ report("aquiring math data, table saved in %s",outname)
---~ end
---~ g:write("}\n")
---~ g:close()
---~ f:close()
---~ end
---~ end
-
function scripts.chars.stixtomkiv(inname,outname)
report("we no longer use this options but use our own tables instead")
end
@@ -133,6 +63,17 @@ local banner_pdf_2 = [[
\endinput
]]
+local f_tounicode = formatters['\\pdfglyphtounicode{%s}{%04X}%%\n']
+local f_case = formatters['\\setXTXcharcodes "%05X "%05X "%05X %% %s\n']
+local f_range = formatters['\\dofastrecurse{"%05X}{"%05X}{1}{\\dosetXTXcharcodes\\recurselevel\\recurselevel\\recurselevel}\n']
+local f_classes = formatters['\\dofastrecurse{"%05X}{"%05X}{1}{\\dosetXTXcharacterclass\\fastrecursecounter{lb:%s}}\n']
+local f_charclass_a = formatters['\\defineXTXcharinjectionclass[lb:%s]\n']
+local f_charclass_b = formatters['\\dosetXTXcharacterclass{"%05X}{lb:%s}\n']
+local f_charclass_c = formatters['\\dofastrecurse{"%05X}{"%05X}{1}{\\dosetXTXcharacterclass\\fastrecursecounter{lb:%s}}\n']
+local f_hex = formatters['%s %05X"']
+local f_unicode = formatters['U+%05X']
+local f_entity = formatters[' ["%s"] = %q, -- %s']
+
function scripts.chars.makepdfr()
local chartable = resolvers.findfile("char-def.lua") or ""
if chartable ~= "" then
@@ -146,7 +87,7 @@ function scripts.chars.makepdfr()
for i=1,#sd do
local char = cd[sd[i]]
if char.adobename then
- f:write(format("\\pdfglyphtounicode{%s}{%04X}%%\n",char.adobename,char.unicodeslot))
+ f:write(f_tounicode(char.adobename,char.unicodeslot))
end
end
f:write(banner_pdf_2)
@@ -156,13 +97,13 @@ function scripts.chars.makepdfr()
end
end
-local banner_utf_module = [[
+local banner_utf_module = formatters [ [[
%% filename : %s
%% comment : generated by mtxrun --script chars --xtx
%% author : Hans Hagen, PRAGMA-ADE, Hasselt NL
%% copyright: PRAGMA ADE / ConTeXt Development Team
%% license : see context related readme files
-]]
+]] ]
local banner_utf_mappings = [[
@@ -219,7 +160,7 @@ function scripts.chars.makeencoutf()
local f = io.open(name,'w')
if f then
report("writing '%s'",name)
- f:write(format(banner_utf_module,name))
+ f:write(banner_utf_module(name))
f:write(banner)
f:write()
return f
@@ -232,7 +173,7 @@ function scripts.chars.makeencoutf()
local data = characters and characters.data
if data then
local list = table.sortedkeys(characters.data)
- local f = open("xetx-utf.tex",banner_utf_mappings)
+ local f = open("xetx-utf.mkii",banner_utf_mappings)
if f then
for i=1,#list do
local code = list[i]
@@ -240,9 +181,15 @@ function scripts.chars.makeencoutf()
local chr = data[code]
local cc = chr.category
if cc == 'll' or cc == 'lu' or cc == 'lt' then
- if not chr.lccode then chr.lccode = code end
- if not chr.uccode then chr.uccode = code end
- f:write(format('\\setXTXcharcodes "%05X "%05X "%05X %% %s\n',code,chr.lccode,chr.uccode,chr.description))
+ local lccode = chr.lccode or code
+ local uccode = chr.uccode or code
+ if type(lccode) == "table" then
+ lccode = code
+ end
+ if type(uccode) == "table" then
+ uccode = code
+ end
+ f:write(f_case(code,lccode,uccode,chr.description))
end
end
end
@@ -253,51 +200,57 @@ function scripts.chars.makeencoutf()
if chr and chr.range then
local cc = chr.category
if cc == 'lo' then
- f:write(format('\\dofastrecurse{"%05X}{"%05X}{1}{\\dosetXTXcharcodes\\recurselevel\\recurselevel\\recurselevel}\n',code,chr.range))
+ f:write(f_range(code,chr.range))
end
end
end
f:write(banner_utf_patch)
close(f)
end
- local f = open("xetx-chr.tex",banner_utf_names)
+ local f = open("xetx-chr.mkii",banner_utf_names)
if f then
local length = 0
for i=1,#list do
local code = list[i]
if code > 0x5B and code <= 0xFFFF then
local chr = data[code]
- if chr and #(chr.contextname or "") > length then
- length = #chr.contextname
+ if chr then
+ local l = #(chr.contextname or "")
+ if l > length then
+ length = l
+ end
end
end
end
- local template = "\\def\\%-".. length .. "s{\\char\"%05X } %% %s: %s\n"
+ local f_def = formatters["\\def\\%-".. length .. "s{\\char\"%05X } %% %s: %s\n"]
for i=1,#list do
local code = list[i]
if code > 0x5B and code <= 0xFFFF then
local chr = data[code]
- if chr and chr.contextname then
- local ch = utfchar(code)
- f:write(format(template, chr.contextname, code, chr.description, ch))
+ if chr then
+ local contextname = chr.contextname
+ if contextname and not find(contextname,"space$") then
+ local ch = utfchar(code)
+ f:write(f_def(contextname, code, chr.description, ch))
+ end
end
end
end
close(f)
end
- local f = open("xetx-cls.tex",banner_utf_classes)
+ local f = open("xetx-cls.mkii",banner_utf_classes)
if f then
for k, v in next, xtxclasses do
- f:write(format("\\defineXTXcharinjectionclass[lb:%s]\n",k))
+ f:write(f_charclass_a(k))
end
f:write("\n")
local i_first, i_last, i_clb = nil, nil, nil
local function flush()
if i_first then
if i_first == i_last then
- f:write(format('\\dosetXTXcharacterclass{"%05X}{lb:%s}\n',i_first,i_clb))
+ f:write(f_charclass_b(i_first,i_clb))
else
- f:write(format('\\dofastrecurse{"%05X}{"%05X}{1}{\\dosetXTXcharacterclass\\fastrecursecounter{lb:%s}}\n',i_first,i_last,i_clb))
+ f:write(f_charclass_c(i_first,i_last,i_clb))
end
end
i_first, i_last, i_clb = nil, nil, nil
@@ -330,7 +283,7 @@ function scripts.chars.makeencoutf()
if chr and chr.range then
local lbc = chr.linebreak
if xtxclasses[lbc] then
- f:write(format('\\dofastrecurse{"%05X}{"%05X}{1}{\\dosetXTXcharacterclass\\fastrecursecounter{lb:%s}}\n',code,chr.range,lbc))
+ f:write(f_classes(code,chr.range,lbc))
end
end
end
@@ -362,11 +315,11 @@ function scripts.chars.xmlentities()
if name == "newline" then
-- let's forget about that one
elseif name == "lt" then
- str, hex = "<", format("%s %05X",hex,c)
+ str, hex = "<", f_hex(hex,c)
elseif name == "gt" then
- str, hex = ">", format("%s %05X",hex,c)
+ str, hex = ">", f_hex(hex,c)
elseif name == "amp" then
- str, hex = "&", format("%s %05X",hex,c)
+ str, hex = "&", f_hex(hex,c)
else
for t, c in gmatch(value,"&#([x]*)([^;]+);") do
if t == "x" then
@@ -375,14 +328,14 @@ function scripts.chars.xmlentities()
c = tonumber(c)
end
if str then
- str, hex = str .. utfchar(c), format("%s %05X",hex,c)
+ str, hex = str .. utfchar(c), f_hex(hex,c)
else
- str, hex = utfchar(c), format("U+%05X",c)
+ str, hex = utfchar(c), f_unicode(c)
end
end
end
if str and hex then
- entities[#entities+1] = format(' ["%s"] = %q, -- %s',name,str,hex)
+ entities[#entities+1] = f_entity(name,str,hex)
end
end
end
@@ -406,28 +359,3 @@ elseif environment.argument("exporthelp") then
else
application.help()
end
-
--- local http = require("socket.http")
--- local ltn12 = require("ltn12")
---
--- local t = { }
--- local status, message = http.request {
--- url = f,
--- sink = ltn12.sink.table(t)
--- }
---
--- local template = [[
--- <?xml version='1.0' ?>
---
--- <!DOCTYPE dummy [
---
--- %s
---
--- ]>
---
--- <dummy>This is just a placeholder.</dummy>
--- ]]
---
--- local e = string.format(template,io.loaddata(n))
--- local x = xml.convert(e, { utfize_entities = true } )
--- local entities = x.entities
diff --git a/scripts/context/lua/mtx-fonts.lua b/scripts/context/lua/mtx-fonts.lua
index 7fee3c162..357df0688 100644
--- a/scripts/context/lua/mtx-fonts.lua
+++ b/scripts/context/lua/mtx-fonts.lua
@@ -43,7 +43,7 @@ local helpinfo = [[
<flag name="info"><short>give more details</short></flag>
<flag name="trackers" value="list"><short>enable trackers</short></flag>
<flag name="statistics"><short>some info about the database</short></flag>
- <flag name="names"><short>uise name instead of unicodes</short></flag>
+ <flag name="names"><short>use name instead of unicodes</short></flag>
</subcategory>
</category>
</flags>
@@ -72,9 +72,9 @@ local helpinfo = [[
<example><command>mtxrun --script font --list --file --pattern=*somename*</command></example>
</subcategory>
<subcategory>
- <example><command>mtxrun --script font --save --texgyrepagella-regular.otf</command></example>
- <example><command>mtxrun --script font --convert --texgyrepagella-regular.otf</command></example>
- <example><command>mtxrun --script font --convert --names --texgyrepagella-regular.otf</command></example>
+ <example><command>mtxrun --script font --save texgyrepagella-regular.otf</command></example>
+ <example><command>mtxrun --script font --convert texgyrepagella-regular.otf</command></example>
+ <example><command>mtxrun --script font --convert --names texgyrepagella-regular.otf</command></example>
</subcategory>
</category>
</examples>
diff --git a/scripts/context/lua/mtx-package.lua b/scripts/context/lua/mtx-package.lua
index 8c9e6b9fc..23da30bf2 100644
--- a/scripts/context/lua/mtx-package.lua
+++ b/scripts/context/lua/mtx-package.lua
@@ -55,7 +55,7 @@ function scripts.package.merge_luatex_files(name)
collected[#collected+1] = format("-- parent file : %s\n",oldname)
collected[#collected+1] = format("-- merge date : %s\n",os.date())
-- loadmodule can have extra arguments
- for lib in gmatch(data,"loadmodule *%([\'\"](.-)[\'\"]") do
+ for lib in gmatch(data,"loadmodule *%([\'\"](.-)[\'\"]") do -- todo: not -- lines
if file.basename(lib) ~= file.basename(newname) then
local fullname = resolvers.findfile(lib) or ""
if fullname == "" then
diff --git a/scripts/context/lua/mtx-profile.lua b/scripts/context/lua/mtx-profile.lua
index 0d0c28084..355694e28 100644
--- a/scripts/context/lua/mtx-profile.lua
+++ b/scripts/context/lua/mtx-profile.lua
@@ -8,8 +8,9 @@ if not modules then modules = { } end modules ['mtx-profile'] = {
-- todo: also line number
-- todo: sort runtime as option
+-- todo: make it more efficient .. real old code
-local match, format, find = string.match, string.format, string.find
+local match, format, find, gsub = string.match, string.format, string.find, string.gsub
local helpinfo = [[
<?xml version="1.0"?>
@@ -57,7 +58,7 @@ function scripts.profiler.analyze(filename)
local totalruntime, totalcount, totalcalls = 0, 0, 0
for line in f:lines() do
if not find(line,"__index") and not find(line,"__newindex") then
- local stacklevel, filename, functionname, linenumber, currentline, localtime, totaltime = line:match("^(%d+)\t(.-)\t(.-)\t(.-)\t(.-)\t(.-)\t(.-)")
+ local stacklevel, filename, functionname, linenumber, currentline, localtime, totaltime = match(line,"^(%d+)\t(.-)\t(.-)\t(.-)\t(.-)\t(.-)\t(.-)")
if not filename then
-- next
elseif filename == "=[C]" then
@@ -65,7 +66,7 @@ function scripts.profiler.analyze(filename)
calls[functionname] = (calls[functionname] or 0) + 1
end
else
- local filename = filename:match("^@(.*)$")
+ local filename = match(filename,"^@(.*)$")
if filename then
local fi = times[filename]
if not fi then fi = { } times[filename] = fi end
@@ -90,7 +91,7 @@ function scripts.profiler.analyze(filename)
totalcount = totalcount + count
if totaltime > timethreshold or count > countthreshold then
totalruntime = totalruntime + totaltime
- local functionfile, somenumber = functionname:match("^@(.+):(.-)$")
+ local functionfile, somenumber = match(functionname,"^@(.+):(.-)$")
if functionfile then
local number = tonumber(somenumber)
if number then
@@ -98,13 +99,13 @@ function scripts.profiler.analyze(filename)
loaded[functionfile] = string.splitlines(io.loaddata(functionfile) or "")
end
functionname = loaded[functionfile][number] or functionname
- functionname = functionname:gsub("^%s*","")
- functionname = functionname:gsub("%s*%-%-.*$","")
+ functionname = gsub(functionname,"^%s*","")
+ functionname = gsub(functionname,"%s*%-%-.*$","")
functionname = number .. ": " .. functionname
end
end
filename = file.basename(filename)
- print(functiontemplate:format(filename,totaltime,count,functionname))
+ print(format(functiontemplate,filename,totaltime,count,functionname))
end
end
end
@@ -149,7 +150,7 @@ function scripts.profiler.x_analyze(filename)
end
f:close()
local noc = 0
-local criterium = 100
+ local criterium = 100
for name, n in next, calls do
if n > criterium then
if find(name,"^@@[a-z][a-z]") then
diff --git a/scripts/context/lua/mtx-unicode.lua b/scripts/context/lua/mtx-unicode.lua
new file mode 100644
index 000000000..b76cf675e
--- /dev/null
+++ b/scripts/context/lua/mtx-unicode.lua
@@ -0,0 +1,514 @@
+if not modules then modules = { } end modules ['mtx-unicode'] = {
+ version = 1.002,
+ comment = "companion to mtxrun.lua",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- This is very old code that I started writing in 2005 but occasionally
+-- extended. Don't use it yourself, it's just a sort of reference. The
+-- data that we use in ConTeXt is more extensive.
+--
+-- In my local tree I keep files in places like this:
+--
+-- e:/tex-context/tex/texmf-local/data/unicode/blocks.txt
+--
+-- last checked:
+--
+-- code freeze tl 2014 / unicode 7
+--
+-- todo:
+--
+-- specialcasing ?
+
+local helpinfo = [[
+<?xml version="1.0"?>
+<application>
+ <metadata>
+ <entry name="name">mtx-unicode</entry>
+ <entry name="detail">Checker for char-dat.lua</entry>
+ <entry name="version">1.02</entry>
+ </metadata>
+ <flags>
+ <category name="basic">
+ <subcategory>
+ <flag name="whatever"><short>do whatever</short></flag>
+ </subcategory>
+ </category>
+ </flags>
+</application>
+]]
+
+local application = logs.application {
+ name = "mtx-unicode",
+ banner = "Checker for char-def.lua 1.02",
+ helpinfo = helpinfo,
+}
+
+local gmatch, match, gsub, find, lower, format = string.gmatch, string.match, string.gsub, string.find, string.lower, string.format
+local concat = table.concat
+local split = string.split
+local are_equal = table.are_equal
+local tonumber = tonumber
+local lpegmatch = lpeg.match
+local formatters = string.formatters
+
+local report = application.report
+
+scripts = scripts or { }
+scripts.unicode = scripts.unicode or { }
+
+characters = characters or { }
+characters.data = characters.data or { }
+
+fonts = fonts or { }
+fonts.encodings = fonts.encodings or { }
+
+local textfiles = { }
+local textdata = { }
+
+local sparse = false
+
+local split_space_table = lpeg.tsplitat(" ")
+local split_space_two = lpeg.splitat (" ")
+local split_range_two = lpeg.splitat ("..")
+local split_colon_table = lpeg.tsplitat(lpeg.P(" ")^0 * lpeg.P(";") * lpeg.P(" ")^0)
+
+function scripts.unicode.update()
+ local unicodedata = texttables.unicodedata
+ local bidimirroring = texttables.bidimirroring
+ local linebreak = texttables.linebreak
+ local eastasianwidth = texttables.eastasianwidth
+ local standardizedvariants = texttables.standardizedvariants
+ local arabicshaping = texttables.arabicshaping
+ local characterdata = characters.data
+ --
+ for unicode, ud in table.sortedpairs(unicodedata) do
+ local char = rawget(characterdata,unicode)
+ local description = ud[2] or formatters["UNICODE ENTRY %U"](unicode)
+ if not find(description,"^<") then
+ local ld = linebreak[unicode]
+ local bd = bidimirroring[unicode]
+ local ed = eastasianwidth[unicode]
+ local category = lower(ud[3] or "?")
+ local combining = tonumber(ud[4])
+ local direction = lower(ud[5] or "l") -- we could omit 'l' being the default
+ local linebreak = ld and lower(ld[2] or "xx")
+ local specials = ud[6] or ""
+ local cjkwd = ed and lower(ed[2] or "n")
+ local mirror = bd and tonumber(bd[2],16)
+ local arabic = nil
+ if sparse and direction == "l" then
+ direction = nil
+ end
+ if linebreak == "xx" then
+ linebreak = nil
+ end
+ if specials == "" then
+ specials = nil
+ else
+ specials = lpegmatch(split_space_table,specials) -- split(specials," ")
+ if tonumber(specials[1],16) then
+ for i=#specials,1,-1 do
+ specials[i+1] = tonumber(specials[i],16)
+ end
+ specials[1] = "char"
+ else
+ specials[1] = lower(gsub(specials[1],"[<>]",""))
+ for i=2,#specials do
+ specials[i] = tonumber(specials[i],16)
+ end
+ end
+ end
+ if cjkwd == "n" then
+ cjkwd = nil
+ end
+ local comment
+ if find(description,"MATHEMATICAL") then
+ comment = "check math properties"
+ end
+ -- there are more than arabic
+ local as = arabicshaping[unicode]
+ if as then
+ arabic = lower(as[3])
+ end
+ --
+ if not combining or combining == 0 then
+ combining = nil
+ end
+ if not char then
+ report("%U : adding entry %a",unicode,description)
+ char = {
+ -- adobename = ,
+ category = category,
+ comment = comment,
+ cjkwd = cjkwd,
+ description = description,
+ direction = direction,
+ mirror = mirror,
+ linebreak = linebreak,
+ unicodeslot = unicode,
+ specials = specials,
+ arabic = arabic,
+ combining = combining,
+ }
+ characterdata[unicode] = char
+ else
+ if direction then
+ if char.direction ~= direction then
+ report("%U : setting direction to %a, %a",unicode,direction,description)
+ char.direction = direction
+ end
+ else
+ if char.direction then
+ report("%U : resetting direction from %a, %a",unicode,char.direction,description)
+ char.direction = nil
+ end
+ end
+ if mirror then
+ if mirror ~= char.mirror then
+ report("%U : setting mirror to %a, %a",unicode,mirror,description)
+ char.mirror = mirror
+ end
+ else
+ if char.mirror then
+ report("%U : resetting mirror from %a, %a",unicode,char.mirror,description)
+ char.mirror = nil
+ end
+ end
+ if linebreak then
+ if linebreak ~= char.linebreak then
+ report("%U : setting linebreak to %a, %a",unicode,linebreak,description)
+ char.linebreak = linebreak
+ end
+ else
+ if char.linebreak then
+ report("%U : resetting linebreak from %a, %a",unicode,char.linebreak,description)
+ char.linebreak = nil
+ end
+ end
+ if cjkwd then
+ if cjkwd ~= char.cjkwd then
+ report("%U : setting cjkwd of to %a, %a",unicode,cjkwd,description)
+ char.cjkwd = cjkwd
+ end
+ else
+ if char.cjkwd then
+ report("%U : resetting cjkwd of from %a, %a",unicode,char.cjkwd,description)
+ char.cjkwd = nil
+ end
+ end
+ if arabic then
+ if arabic ~= char.arabic then
+ report("%U : setting arabic to %a, %a",unicode,arabic,description)
+ char.arabic = arabic
+ end
+ else
+ if char.arabic then
+ report("%U : resetting arabic from %a, %a",unicode,char.arabic,description)
+ char.arabic = nil
+ end
+ end
+ if combining then
+ if combining ~= char.combining then
+ report("%U : setting combining to %a, %a",unicode,combining,description)
+ char.combining = combining
+ end
+ else
+ if char.combining then
+ report("%U : resetting combining from %a, %a",unicode,char.combining,description)
+ end
+ end
+ if specials then
+ if not char.specials or not are_equal(specials,char.specials) then
+ local t = { specials[1] } for i=2,#specials do t[i] = formatters["%U"](specials[i]) end
+ report("%U : setting specials to % + t, %a",unicode,t,description)
+ char.specials = specials
+ end
+ else
+ local specials = char.specials
+ if specials then
+ local t = { } for i=2,#specials do t[i] = formatters["%U"](specials[i]) end
+ if false then
+ char.comment = nil
+ report("%U : resetting specials from % + t, %a",unicode,t,description)
+ else
+ local comment = char.comment
+ if not comment then
+ char.comment = "check special"
+ elseif not find(comment,"check special") then
+ char.comment = comment .. ", check special"
+ end
+ report("%U : check specials % + t, %a",unicode,t,description)
+ end
+ end
+ end
+ end
+ --
+ local visual = char.visual
+ if not visual and find(description,"MATH") then
+ if find(description,"BOLD ITALIC") then
+ visual = "bi"
+ elseif find(description,"ITALIC") then
+ visual = "it"
+ elseif find(description,"BOLD") then
+ visual = "bf"
+ end
+ if visual then
+ report("%U : setting visual to %a, %a",unicode,visual,description)
+ char.visual = visual
+ end
+ end
+ -- mathextensible
+ if category == "sm" or (category == "so" and char.mathclass) then
+ local mathextensible = char.mathextensible
+ if mathextensible then
+ -- already done
+ elseif find(description,"ABOVE") then
+ -- skip
+ elseif find(description,"ARROWHEAD") then
+ -- skip
+ elseif find(description,"HALFWIDTH") then
+ -- skip
+ elseif find(description,"ANGLE") then
+ -- skip
+ elseif find(description,"THROUGH") then
+ -- skip
+ elseif find(description,"ARROW") then
+ -- skip
+ local u = find(description,"UP")
+ local d = find(description,"DOWN")
+ local l = find(description,"LEFT")
+ local r = find(description,"RIGHT")
+ if find(description,"ARROWHEAD") then
+ -- skip
+ elseif find(description,"HALFWIDTH") then
+ -- skip
+ elseif u and d then
+ if l or r then
+ mathextensible = 'm' -- mixed
+ else
+ mathextensible = 'v' -- vertical
+ end
+ elseif u then
+ if l or r then
+ mathextensible = 'm' -- mixed
+ else
+ mathextensible = "u" -- up
+ end
+ elseif d then
+ if l or r then
+ mathextensible = 'm' -- mixed
+ else
+ mathextensible = "d" -- down
+ end
+ elseif l and r then
+ mathextensible = "h" -- horizontal
+ elseif r then
+ mathextensible = "r" -- right
+ elseif l then
+ mathextensible = "l" -- left
+ end
+ if mathextensible then
+ report("%U : setting mathextensible to %a, %a",unicode,mathextensible,description)
+ char.mathextensible = mathextensible
+ end
+ end
+ end
+ end
+ end
+ for i=1,#standardizedvariants do
+ local si = standardizedvariants[i]
+ local pair, addendum = si[1], string.strip(si[2])
+ local first, second = lpegmatch(split_space_two,pair) -- string.splitup(pair," ")
+ first = tonumber(first,16)
+ second = tonumber(second,16)
+ if first then
+ local d = characterdata[first]
+ if d then
+ local v = d.variants
+ if not v then
+ v = { }
+ d.variants = v
+ end
+ if not v[second] then
+ report("%U : adding variant %U as %s, %a",first,second,addendum,d.description)
+ v[second] = addendum
+ end
+ end
+ end
+ end
+end
+
+local preamble
+
+local function splitdefinition(str,index)
+ local l = string.splitlines(str)
+ local t = { }
+ if index then
+ for i=1,#l do
+ local s = gsub(l[i]," *#.*$","")
+ if s ~= "" then
+ local d = lpegmatch(split_colon_table,s) -- split(s,";")
+ local o = d[1]
+ local u = tonumber(o,16)
+ if u then
+ t[u] = d
+ else
+ -- local b, e = match(o,"^([^%.]+)%.%.([^%.]+)$")
+ local b, e = lpegmatch(split_range_two,o)
+ if b and e then
+ b = tonumber(b,16)
+ e = tonumber(e,16)
+ for k=b,e do
+ t[k] = d
+ end
+ else
+ report("problem: %s",s)
+ end
+ end
+ end
+ end
+ else
+ local n = 0
+ for i=1,#l do
+ local s = gsub(l[i]," *#.*$","")
+ if s ~= "" then
+ n = n + 1
+ t[n] = lpegmatch(split_colon_table,s) -- split(s,";")
+ end
+ end
+ end
+ return t
+end
+
+function scripts.unicode.load()
+ local fullname = resolvers.findfile("char-def.lua")
+ report("using: %s",fullname)
+ local data = io.loaddata(fullname)
+ if data then
+ loadstring(data)()
+ --
+ local fullname = resolvers.findfile("char-ini.lua")
+ report("using: %s",fullname)
+ dofile(fullname)
+ --
+ local fullname = resolvers.findfile("char-utf.lua")
+ report("using: %s",fullname)
+ dofile(fullname)
+ --
+ local fullname = resolvers.findfile("char-cjk.lua")
+ report("using: %s",fullname)
+ dofile(fullname)
+ --
+ preamble = data:gsub("characters%.data%s*=%s*%{.*","")
+ --
+ textfiles = {
+ unicodedata = resolvers.findfile("unicodedata.txt") or "",
+ bidimirroring = resolvers.findfile("bidimirroring.txt") or "",
+ linebreak = resolvers.findfile("linebreak.txt") or "",
+ eastasianwidth = resolvers.findfile("eastasianwidth.txt") or "",
+ standardizedvariants = resolvers.findfile("standardizedvariants.txt") or "",
+ arabicshaping = resolvers.findfile("arabicshaping.txt") or "",
+ }
+ --
+ textdata = {
+ unicodedata = textfiles.unicodedata ~= "" and io.loaddata(textfiles.unicodedata) or "",
+ bidimirroring = textfiles.bidimirroring ~= "" and io.loaddata(textfiles.bidimirroring) or "",
+ linebreak = textfiles.linebreak ~= "" and io.loaddata(textfiles.linebreak) or "",
+ eastasianwidth = textfiles.eastasianwidth ~= "" and io.loaddata(textfiles.eastasianwidth) or "",
+ standardizedvariants = textfiles.standardizedvariants ~= "" and io.loaddata(textfiles.standardizedvariants) or "",
+ arabicshaping = textfiles.arabicshaping ~= "" and io.loaddata(textfiles.arabicshaping) or "",
+ }
+ texttables = {
+ unicodedata = splitdefinition(textdata.unicodedata,true),
+ bidimirroring = splitdefinition(textdata.bidimirroring,true),
+ linebreak = splitdefinition(textdata.linebreak,true),
+ eastasianwidth = splitdefinition(textdata.eastasianwidth,true),
+ standardizedvariants = splitdefinition(textdata.standardizedvariants,false),
+ arabicshaping = splitdefinition(textdata.arabicshaping,true),
+ }
+ return true
+ else
+ preamble = nil
+ return false
+ end
+end
+
+function scripts.unicode.save(filename)
+ if preamble then
+ io.savedata(filename,preamble .. table.serialize(characters.data,"characters.data", { hexify = true, noquotes = true } ))
+ end
+end
+
+function scripts.unicode.extras() -- old code
+ --
+ -- 0000..007F; Basic Latin
+ -- 0080..00FF; Latin-1 Supplement
+ -- 0100..017F; Latin Extended-A
+ --
+ local fullname = resolvers.findfile("blocks.txt") or ""
+ if fullname ~= "" then
+ local data = io.loaddata(fullname)
+ local lines = string.splitlines(data)
+ local map = { }
+ local blocks = characters.blocks
+ local result = { }
+ for i=1,#lines do
+ local line = gsub(lines[i]," *#.*$","")
+ if line ~= "" then
+ local specification = lpegmatch(split_colon_table,line) -- split(s,";")
+ local range = specification[1]
+ local description = specification[2]
+ if range and description then
+ local start, stop = lpegmatch(split_range_two,range)
+ if start and stop then
+ local start = tonumber(start,16)
+ local stop = tonumber(stop,16)
+ local name = gsub(lower(description),"[^a-z]+","")
+ if start and stop then
+ local b = blocks[name]
+ if not b then
+ result[#result+1] = formatters[ [[+ block: ["%s"] = { first = 0x%05X, last = 0x%05X, description = "%S" }]] ](name,start,stop,description)
+ blocks[name] = { first = start, last = stop, description = description }
+ elseif b.first ~= start or b.last ~= stop or b.description ~= description then
+ result[#result+1] = formatters[ [[? block: ["%s"] = { first = 0x%05X, last = 0x%05X, description = "%S" }]] ](name,start,stop,description)
+ end
+ end
+ map[#map+1] = name
+ end
+ end
+ end
+ end
+ table.sort(result)
+ for i=1,#result do
+ report(result[i])
+ end
+ table.sort(map)
+ for i=1,#map do
+ local m = map[i]
+ if not blocks[m] then
+ report("obsolete block %a",m)
+ end
+ end
+ end
+end
+
+-- the action
+
+local filename = environment.files[1]
+
+if environment.arguments.exporthelp then
+ application.export(environment.arguments.exporthelp,filename)
+else
+ report("start working on %a, input char-def.lua",lfs.currentdir())
+ if scripts.unicode.load() then
+ scripts.unicode.update()
+ scripts.unicode.extras()
+ scripts.unicode.save("char-def-new.lua")
+ else
+ report("nothing to do")
+ end
+ report("stop working on %a, output char-def-new.lua\n",lfs.currentdir())
+end
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index 15034149b..106931707 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -7044,7 +7044,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-prs"] = package.loaded["util-prs"] or true
--- original size: 22496, stripped down to: 15539
+-- original size: 22839, stripped down to: 15769
if not modules then modules={} end modules ['util-prs']={
version=1.001,
@@ -7068,6 +7068,8 @@ local setmetatableindex=table.setmetatableindex
local sortedhash=table.sortedhash
local sortedkeys=table.sortedkeys
local tohash=table.tohash
+local hashes={}
+utilities.parsers.hashes=hashes
local digit=R("09")
local space=P(' ')
local equal=P("=")
@@ -7286,9 +7288,15 @@ function parsers.array_to_string(a,separator)
end
end
local pattern=Cf(Ct("")*Cg(C((1-S(", "))^1)*S(", ")^0*Cc(true))^1,rawset)
-function utilities.parsers.settings_to_set(str,t)
+function utilities.parsers.settings_to_set(str)
return str and lpegmatch(pattern,str) or {}
end
+hashes.settings_to_set=table.setmetatableindex(function(t,k)
+ local v=k and lpegmatch(pattern,k) or {}
+ t[k]=v
+ return v
+end)
+getmetatable(hashes.settings_to_set).__mode="kv"
function parsers.simple_hash_to_string(h,separator)
local t,tn={},0
for k,v in sortedhash(h) do
@@ -7959,7 +7967,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 30685, stripped down to: 21298
+-- original size: 30753, stripped down to: 21355
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -8002,6 +8010,9 @@ setmetatableindex(logs,function(t,k) t[k]=ignore;return ignore end)
local report,subreport,status,settarget,setformats,settranslations
local direct,subdirect,writer,pushtarget,poptarget,setlogfile,settimedlog,setprocessor,setformatters,newline
if tex and (tex.jobname or tex.formatname) then
+ if texio.setescape then
+ texio.setescape(0)
+ end
local function useluawrites()
local texio_write_nl=texio.write_nl
local texio_write=texio.write
@@ -8749,7 +8760,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-inf"] = package.loaded["trac-inf"] or true
--- original size: 6913, stripped down to: 5481
+-- original size: 6916, stripped down to: 5484
if not modules then modules={} end modules ['trac-inf']={
version=1.001,
@@ -8870,13 +8881,13 @@ function statistics.show()
end
end
register("lua properties",function()
- local list=status.list()
- local hashchar=tonumber(list.luatex_hashchars)
+ local hashchar=tonumber(status.luatex_hashchars)
+ local hashtype=status.luatex_hashtype
local mask=lua.mask or "ascii"
return format("engine: %s, used memory: %s, hash type: %s, hash chars: min(%s,40), symbol mask: %s (%s)",
jit and "luajit" or "lua",
statistics.memused(),
- list.luatex_hashtype or "default",
+ hashtype or "default",
hashchar and 2^hashchar or "unknown",
mask,
mask=="utf" and "τεχ" or "tex")
@@ -18349,8 +18360,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 781900
--- stripped bytes : 283302
+-- original bytes : 782314
+-- stripped bytes : 283426
-- end library merge
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 15034149b..106931707 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -7044,7 +7044,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-prs"] = package.loaded["util-prs"] or true
--- original size: 22496, stripped down to: 15539
+-- original size: 22839, stripped down to: 15769
if not modules then modules={} end modules ['util-prs']={
version=1.001,
@@ -7068,6 +7068,8 @@ local setmetatableindex=table.setmetatableindex
local sortedhash=table.sortedhash
local sortedkeys=table.sortedkeys
local tohash=table.tohash
+local hashes={}
+utilities.parsers.hashes=hashes
local digit=R("09")
local space=P(' ')
local equal=P("=")
@@ -7286,9 +7288,15 @@ function parsers.array_to_string(a,separator)
end
end
local pattern=Cf(Ct("")*Cg(C((1-S(", "))^1)*S(", ")^0*Cc(true))^1,rawset)
-function utilities.parsers.settings_to_set(str,t)
+function utilities.parsers.settings_to_set(str)
return str and lpegmatch(pattern,str) or {}
end
+hashes.settings_to_set=table.setmetatableindex(function(t,k)
+ local v=k and lpegmatch(pattern,k) or {}
+ t[k]=v
+ return v
+end)
+getmetatable(hashes.settings_to_set).__mode="kv"
function parsers.simple_hash_to_string(h,separator)
local t,tn={},0
for k,v in sortedhash(h) do
@@ -7959,7 +7967,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 30685, stripped down to: 21298
+-- original size: 30753, stripped down to: 21355
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -8002,6 +8010,9 @@ setmetatableindex(logs,function(t,k) t[k]=ignore;return ignore end)
local report,subreport,status,settarget,setformats,settranslations
local direct,subdirect,writer,pushtarget,poptarget,setlogfile,settimedlog,setprocessor,setformatters,newline
if tex and (tex.jobname or tex.formatname) then
+ if texio.setescape then
+ texio.setescape(0)
+ end
local function useluawrites()
local texio_write_nl=texio.write_nl
local texio_write=texio.write
@@ -8749,7 +8760,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-inf"] = package.loaded["trac-inf"] or true
--- original size: 6913, stripped down to: 5481
+-- original size: 6916, stripped down to: 5484
if not modules then modules={} end modules ['trac-inf']={
version=1.001,
@@ -8870,13 +8881,13 @@ function statistics.show()
end
end
register("lua properties",function()
- local list=status.list()
- local hashchar=tonumber(list.luatex_hashchars)
+ local hashchar=tonumber(status.luatex_hashchars)
+ local hashtype=status.luatex_hashtype
local mask=lua.mask or "ascii"
return format("engine: %s, used memory: %s, hash type: %s, hash chars: min(%s,40), symbol mask: %s (%s)",
jit and "luajit" or "lua",
statistics.memused(),
- list.luatex_hashtype or "default",
+ hashtype or "default",
hashchar and 2^hashchar or "unknown",
mask,
mask=="utf" and "τεχ" or "tex")
@@ -18349,8 +18360,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 781900
--- stripped bytes : 283302
+-- original bytes : 782314
+-- stripped bytes : 283426
-- end library merge
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 15034149b..106931707 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -7044,7 +7044,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-prs"] = package.loaded["util-prs"] or true
--- original size: 22496, stripped down to: 15539
+-- original size: 22839, stripped down to: 15769
if not modules then modules={} end modules ['util-prs']={
version=1.001,
@@ -7068,6 +7068,8 @@ local setmetatableindex=table.setmetatableindex
local sortedhash=table.sortedhash
local sortedkeys=table.sortedkeys
local tohash=table.tohash
+local hashes={}
+utilities.parsers.hashes=hashes
local digit=R("09")
local space=P(' ')
local equal=P("=")
@@ -7286,9 +7288,15 @@ function parsers.array_to_string(a,separator)
end
end
local pattern=Cf(Ct("")*Cg(C((1-S(", "))^1)*S(", ")^0*Cc(true))^1,rawset)
-function utilities.parsers.settings_to_set(str,t)
+function utilities.parsers.settings_to_set(str)
return str and lpegmatch(pattern,str) or {}
end
+hashes.settings_to_set=table.setmetatableindex(function(t,k)
+ local v=k and lpegmatch(pattern,k) or {}
+ t[k]=v
+ return v
+end)
+getmetatable(hashes.settings_to_set).__mode="kv"
function parsers.simple_hash_to_string(h,separator)
local t,tn={},0
for k,v in sortedhash(h) do
@@ -7959,7 +7967,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 30685, stripped down to: 21298
+-- original size: 30753, stripped down to: 21355
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -8002,6 +8010,9 @@ setmetatableindex(logs,function(t,k) t[k]=ignore;return ignore end)
local report,subreport,status,settarget,setformats,settranslations
local direct,subdirect,writer,pushtarget,poptarget,setlogfile,settimedlog,setprocessor,setformatters,newline
if tex and (tex.jobname or tex.formatname) then
+ if texio.setescape then
+ texio.setescape(0)
+ end
local function useluawrites()
local texio_write_nl=texio.write_nl
local texio_write=texio.write
@@ -8749,7 +8760,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-inf"] = package.loaded["trac-inf"] or true
--- original size: 6913, stripped down to: 5481
+-- original size: 6916, stripped down to: 5484
if not modules then modules={} end modules ['trac-inf']={
version=1.001,
@@ -8870,13 +8881,13 @@ function statistics.show()
end
end
register("lua properties",function()
- local list=status.list()
- local hashchar=tonumber(list.luatex_hashchars)
+ local hashchar=tonumber(status.luatex_hashchars)
+ local hashtype=status.luatex_hashtype
local mask=lua.mask or "ascii"
return format("engine: %s, used memory: %s, hash type: %s, hash chars: min(%s,40), symbol mask: %s (%s)",
jit and "luajit" or "lua",
statistics.memused(),
- list.luatex_hashtype or "default",
+ hashtype or "default",
hashchar and 2^hashchar or "unknown",
mask,
mask=="utf" and "τεχ" or "tex")
@@ -18349,8 +18360,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 781900
--- stripped bytes : 283302
+-- original bytes : 782314
+-- stripped bytes : 283426
-- end library merge
diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua
index 15034149b..106931707 100644
--- a/scripts/context/stubs/win64/mtxrun.lua
+++ b/scripts/context/stubs/win64/mtxrun.lua
@@ -7044,7 +7044,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-prs"] = package.loaded["util-prs"] or true
--- original size: 22496, stripped down to: 15539
+-- original size: 22839, stripped down to: 15769
if not modules then modules={} end modules ['util-prs']={
version=1.001,
@@ -7068,6 +7068,8 @@ local setmetatableindex=table.setmetatableindex
local sortedhash=table.sortedhash
local sortedkeys=table.sortedkeys
local tohash=table.tohash
+local hashes={}
+utilities.parsers.hashes=hashes
local digit=R("09")
local space=P(' ')
local equal=P("=")
@@ -7286,9 +7288,15 @@ function parsers.array_to_string(a,separator)
end
end
local pattern=Cf(Ct("")*Cg(C((1-S(", "))^1)*S(", ")^0*Cc(true))^1,rawset)
-function utilities.parsers.settings_to_set(str,t)
+function utilities.parsers.settings_to_set(str)
return str and lpegmatch(pattern,str) or {}
end
+hashes.settings_to_set=table.setmetatableindex(function(t,k)
+ local v=k and lpegmatch(pattern,k) or {}
+ t[k]=v
+ return v
+end)
+getmetatable(hashes.settings_to_set).__mode="kv"
function parsers.simple_hash_to_string(h,separator)
local t,tn={},0
for k,v in sortedhash(h) do
@@ -7959,7 +7967,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 30685, stripped down to: 21298
+-- original size: 30753, stripped down to: 21355
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -8002,6 +8010,9 @@ setmetatableindex(logs,function(t,k) t[k]=ignore;return ignore end)
local report,subreport,status,settarget,setformats,settranslations
local direct,subdirect,writer,pushtarget,poptarget,setlogfile,settimedlog,setprocessor,setformatters,newline
if tex and (tex.jobname or tex.formatname) then
+ if texio.setescape then
+ texio.setescape(0)
+ end
local function useluawrites()
local texio_write_nl=texio.write_nl
local texio_write=texio.write
@@ -8749,7 +8760,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-inf"] = package.loaded["trac-inf"] or true
--- original size: 6913, stripped down to: 5481
+-- original size: 6916, stripped down to: 5484
if not modules then modules={} end modules ['trac-inf']={
version=1.001,
@@ -8870,13 +8881,13 @@ function statistics.show()
end
end
register("lua properties",function()
- local list=status.list()
- local hashchar=tonumber(list.luatex_hashchars)
+ local hashchar=tonumber(status.luatex_hashchars)
+ local hashtype=status.luatex_hashtype
local mask=lua.mask or "ascii"
return format("engine: %s, used memory: %s, hash type: %s, hash chars: min(%s,40), symbol mask: %s (%s)",
jit and "luajit" or "lua",
statistics.memused(),
- list.luatex_hashtype or "default",
+ hashtype or "default",
hashchar and 2^hashchar or "unknown",
mask,
mask=="utf" and "τεχ" or "tex")
@@ -18349,8 +18360,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 781900
--- stripped bytes : 283302
+-- original bytes : 782314
+-- stripped bytes : 283426
-- end library merge