diff options
author | Karl Berry <karl@freefriends.org> | 2017-02-21 23:29:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-02-21 23:29:27 +0000 |
commit | 516a8bbf9db95a88ce2fdd2cf3407216f67e8049 (patch) | |
tree | 8a6508ac24539e2003f1efd5c758cdcea9e6891b /Master/texmf-dist/tex/latex/base/ltluatex.lua | |
parent | 7714e343948bfc6ff5fd5c4b7297c229f37070fa (diff) |
latex (21feb17)
git-svn-id: svn://tug.org/texlive/trunk@43287 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/base/ltluatex.lua')
-rw-r--r-- | Master/texmf-dist/tex/latex/base/ltluatex.lua | 44 |
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") |