summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty26
1 files changed, 10 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty
index d839e544bb3..5a78ea8a4fa 100644
--- a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty
+++ b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty
@@ -52,7 +52,7 @@
\let\x\ProvidesPackage
\fi
\expandafter\endgroup
-\x{luatexbase-attr}[2010/05/12 v0.2 Attributes allocation for LuaTeX]
+\x{luatexbase-attr}[2010/05/27 v0.2a Attributes allocation for LuaTeX]
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname RequirePackage\endcsname\relax
\input ifluatex.sty
@@ -88,28 +88,22 @@
\RequirePackage{luatexbase-loader}
\fi
\luatexbase@directlua{require('luatexbase.attr')}
-\newcount\lltxb@attribute@alloc
-\lltxb@attribute@alloc\m@ne
\def\newluatexattribute#1{%
- \ifnum\lltxb@attribute@alloc<65535\relax
- \global\advance\lltxb@attribute@alloc\@ne
- \allocationnumber\lltxb@attribute@alloc
+ \begingroup\escapechar\m@ne \expandafter\expandafter\expandafter
+ \endgroup \expandafter\expandafter\expandafter
+ \allocationnumber \luatexbase@directlua{tex.write(
+ luatexbase.new_attribute("\luatexluaescapestring{\string#1}", true))}%
+ \ifnum\allocationnumber>\m@ne
\global\luatexattributedef#1=\allocationnumber
- \unsetluatexattribute#1%
- \begingroup\escapechar\m@ne
- \luatexbase@directlua{luatexbase.attributedef_from_tex(
- '\luatexluaescapestring{\string#1}', '\number\allocationnumber')}%
- \endgroup
\wlog{\string#1=\string\luatexattribute\the\allocationnumber}%
\else
\errmessage{No room for a new \string\attribute}%
\fi}
\def\unsetluatexattribute#1{%
- \ifnum\luatexversion<37\relax
- #1=-1\relax
- \else
- #1=-"7FFFFFFF\relax
- \fi}
+ \begingroup\escapechar\m@ne
+ \luatexbase@directlua{%
+ luatexbase.unset_attribute("\luatexluaescapestring{\string#1}")}%
+ \endgroup}
\def\setluatexattribute#1#2{%
#1=\numexpr#2\relax}
\lltxb@attr@AtEnd