summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/base/ltluatex.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/base/ltluatex.lua')
-rw-r--r--Master/texmf-dist/tex/latex/base/ltluatex.lua44
1 files changed, 24 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/latex/base/ltluatex.lua b/Master/texmf-dist/tex/latex/base/ltluatex.lua
index 8ee866ffa16..a2524ca1fc0 100644
--- a/Master/texmf-dist/tex/latex/base/ltluatex.lua
+++ b/Master/texmf-dist/tex/latex/base/ltluatex.lua
@@ -170,45 +170,49 @@ __index = function(t,key)
return registernumber(key) or nil
end}
)
-luatexbase.attributes=attributes
+luatexbase.attributes = attributes
+local attribute_count_name = attribute_count_name or "e@alloc@attribute@count"
local function new_attribute(name)
- tex_setcount("global", "e@alloc@attribute@count",
- tex_count["e@alloc@attribute@count"] + 1)
- if tex_count["e@alloc@attribute@count"] > 65534 then
+ tex_setcount("global", attribute_count_name,
+ tex_count[attribute_count_name] + 1)
+ if tex_count[attribute_count_name] > 65534 then
luatexbase_error("No room for a new \\attribute")
end
- attributes[name]= tex_count["e@alloc@attribute@count"]
+ attributes[name]= tex_count[attribute_count_name]
luatexbase_log("Lua-only attribute " .. name .. " = " ..
- tex_count["e@alloc@attribute@count"])
- return tex_count["e@alloc@attribute@count"]
+ tex_count[attribute_count_name])
+ return tex_count[attribute_count_name]
end
luatexbase.new_attribute = new_attribute
+local whatsit_count_name = whatsit_count_name or "e@alloc@whatsit@count"
local function new_whatsit(name)
- tex_setcount("global", "e@alloc@whatsit@count",
- tex_count["e@alloc@whatsit@count"] + 1)
- if tex_count["e@alloc@whatsit@count"] > 65534 then
+ tex_setcount("global", whatsit_count_name,
+ tex_count[whatsit_count_name] + 1)
+ if tex_count[whatsit_count_name] > 65534 then
luatexbase_error("No room for a new custom whatsit")
end
luatexbase_log("Custom whatsit " .. (name or "") .. " = " ..
- tex_count["e@alloc@whatsit@count"])
- return tex_count["e@alloc@whatsit@count"]
+ tex_count[whatsit_count_name])
+ return tex_count[whatsit_count_name]
end
luatexbase.new_whatsit = new_whatsit
+local bytecode_count_name = bytecode_count_name or "e@alloc@bytecode@count"
local function new_bytecode(name)
- tex_setcount("global", "e@alloc@bytecode@count",
- tex_count["e@alloc@bytecode@count"] + 1)
- if tex_count["e@alloc@bytecode@count"] > 65534 then
+ tex_setcount("global", bytecode_count_name,
+ tex_count[bytecode_count_name] + 1)
+ if tex_count[bytecode_count_name] > 65534 then
luatexbase_error("No room for a new bytecode register")
end
luatexbase_log("Lua bytecode " .. (name or "") .. " = " ..
- tex_count["e@alloc@bytecode@count"])
- return tex_count["e@alloc@bytecode@count"]
+ tex_count[bytecode_count_name])
+ return tex_count[bytecode_count_name]
end
luatexbase.new_bytecode = new_bytecode
+local chunkname_count_name = chunkname_count_name or "e@alloc@luachunk@count"
local function new_chunkname(name)
- tex_setcount("global", "e@alloc@luachunk@count",
- tex_count["e@alloc@luachunk@count"] + 1)
- local chunkname_count = tex_count["e@alloc@luachunk@count"]
+ tex_setcount("global", chunkname_count_name,
+ tex_count[chunkname_count_name] + 1)
+ local chunkname_count = tex_count[chunkname_count_name]
chunkname_count = chunkname_count + 1
if chunkname_count > 65534 then
luatexbase_error("No room for a new chunkname")