summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/minim/minim-alloc.lua
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-03-07 03:02:56 +0000
committerNorbert Preining <norbert@preining.info>2023-03-07 03:02:56 +0000
commit4f55c9271affed648c1a939790a73083043752f5 (patch)
tree5de3491421bbf46cdb941a9a70158ca43e748919 /macros/luatex/generic/minim/minim-alloc.lua
parent75cd005305bd2c2a0ec383f30ee5b1749ed15183 (diff)
CTAN sync 202303070302
Diffstat (limited to 'macros/luatex/generic/minim/minim-alloc.lua')
-rw-r--r--macros/luatex/generic/minim/minim-alloc.lua18
1 files changed, 12 insertions, 6 deletions
diff --git a/macros/luatex/generic/minim/minim-alloc.lua b/macros/luatex/generic/minim/minim-alloc.lua
index 8f6a69ed0d..3775aafa43 100644
--- a/macros/luatex/generic/minim/minim-alloc.lua
+++ b/macros/luatex/generic/minim/minim-alloc.lua
@@ -50,8 +50,8 @@ local function pdf_hex_string(text)
insert_formatted(str, '%04x', i)
else
i = i - 0x10000
- m = math.floor(i/0x400) + 0xd800
- n = ( i % 0x400 ) + 0xdc00
+ local m = math.floor(i/0x400) + 0xd800
+ local n = ( i % 0x400 ) + 0xdc00
insert_formatted(str, '%04x%04x', m, n)
end
end
@@ -177,7 +177,7 @@ end
function M.table_to_text (tbl)
local r = { }
for i,t in pairs(tbl) do
- local l = ''
+ local l
if type(i) == 'string' then
l = string.format('[%q] = ', i)
else
@@ -282,7 +282,7 @@ M.luadef('minim:currentfile', function()
end)
-- make pdf_string() available as \pdfstring{...}
-M.luadef('pdfstring', function() M.pdf_string(token.scan_string()) end)
+M.luadef('pdfstring', function() tex.sprint(M.pdf_string(token.scan_string())) end)
-- uselanguage hook callback
cb.new_callback('uselanguage', 'simple')
@@ -291,6 +291,12 @@ M.luadef('minim:uselanguagecallback', function()
cb.call_callback('uselanguage', langname)
end)
+-- copy of \Ucharcat from xetex
+M.luadef('Ucharcat', function()
+ local chr, cat = token.scan_int(), token.scan_int()
+ token.put_next(token.new(chr, cat))
+end)
+
-- 1 dumping information to the format file
-- reserve a bytecode register
@@ -302,7 +308,7 @@ token.set_macro('minim:restoremodules', '\\luabytecodecall'..saved_tables_byteco
local function dump_saved_tables()
M.msg('pre_dump: save modules and tables to format file')
-- save modules
- for i,name in ipairs (modules) do
+ for _, name in ipairs (modules) do
if not modules[name] then
M.msg('saving module '..name)
-- reserve (if necessary) a bytecode register
@@ -313,7 +319,7 @@ local function dump_saved_tables()
end
-- save tables (and restore modules)
local saved_tables = [[
-
+
-- include all saved tables in this bytecode register
local t = ]]..M.table_to_text(tables)..[[