summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexbase/attr.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-05-28 15:54:16 +0000
committerKarl Berry <karl@freefriends.org>2010-05-28 15:54:16 +0000
commit7db7ee076f98cc2b3dca7228ae0e38ba4e88715a (patch)
treec15a7028a935446f0d5dcce2b5008a6f24e2242f /Master/texmf-dist/tex/luatex/luatexbase/attr.lua
parentae29f8fd830ee6798b80ee088fdd0c92b1a215f4 (diff)
luatexbase update (27may10)
git-svn-id: svn://tug.org/texlive/trunk@18560 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexbase/attr.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/attr.lua23
1 files changed, 21 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/attr.lua b/Master/texmf-dist/tex/luatex/luatexbase/attr.lua
index f794e350812..74ecd6ac07f 100644
--- a/Master/texmf-dist/tex/luatex/luatexbase/attr.lua
+++ b/Master/texmf-dist/tex/luatex/luatexbase/attr.lua
@@ -13,8 +13,27 @@
--
module('luatexbase', package.seeall)
attributes = {}
-function attributedef_from_tex(name, number)
- attributes[name] = tonumber(number)
+local last_alloc = 0
+function new_attribute(name, silent)
+ if last_alloc >= 65535 then
+ if silent then
+ return -1
+ else
+ error("No room for a new \\attribute", 1)
+ end
+ end
+ last_alloc = last_alloc + 1
+ attributes[name] = last_alloc
+ unset_attribute(name)
+ if not silent then
+ texio.write_nl('log', string.format(
+ 'luatexbase.attributes[%q] = %d', name, last_alloc))
+ end
+ return last_alloc
+end
+local unset_value = (luatexbase.luatexversion < 37) and -1 or -2147483647
+function unset_attribute(name)
+ tex.setattribute(attributes[name], unset_value)
end
--
-- End of File `attr.lua'.