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.sty118
1 files changed, 118 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty
new file mode 100644
index 00000000000..d839e544bb3
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty
@@ -0,0 +1,118 @@
+%%
+%% This is file `luatexbase-attr.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% luatexbase-attr.dtx (with options: `texpackage')
+%%
+%% Written in 2009, 2010 by Manuel Pegourie-Gonnard and Elie Roux.
+%%
+%% This work is under the CC0 license.
+%% See source file 'luatexbase-attr.dtx' for details.
+%%
+ \csname lltxb@attr@loaded\endcsname
+\expandafter\let\csname lltxb@attr@loaded\endcsname\endinput
+\begingroup
+ \catcode123 1 % {
+ \catcode125 2 % }
+ \catcode 35 6 % #
+ \toks0{}%
+ \def\x{}%
+ \def\y#1 #2 {%
+ \toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
+ \edef\x{\x \catcode#1 #2}}%
+ \y 123 1 % {
+ \y 125 2 % }
+ \y 35 6 % #
+ \y 10 12 % ^^J
+ \y 34 12 % "
+ \y 36 3 % $ $
+ \y 39 12 % '
+ \y 40 12 % (
+ \y 41 12 % )
+ \y 42 12 % *
+ \y 43 12 % +
+ \y 44 12 % ,
+ \y 45 12 % -
+ \y 46 12 % .
+ \y 47 12 % /
+ \y 60 12 % <
+ \y 61 12 % =
+ \y 64 11 % @ (letter)
+ \y 62 12 % >
+ \y 95 12 % _ (other)
+ \y 96 12 % `
+ \edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}%
+\expandafter\y\csname lltxb@attr@AtEnd\endcsname
+\begingroup
+ \expandafter\ifx\csname ProvidesPackage\endcsname\relax
+ \def\x#1[#2]{\immediate\write16{Package: #1 #2}}
+ \else
+ \let\x\ProvidesPackage
+ \fi
+\expandafter\endgroup
+\x{luatexbase-attr}[2010/05/12 v0.2 Attributes allocation for LuaTeX]
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ifluatex.sty
+\else
+ \RequirePackage{ifluatex}
+\fi
+\ifluatex\else
+ \begingroup
+ \expandafter\ifx\csname PackageWarningNoLine\endcsname\relax
+ \def\x#1#2{\begingroup\newlinechar10
+ \immediate\write16{Package #1 warning: #2}\endgroup}
+ \else
+ \let\x\PackageWarningNoLine
+ \fi
+ \expandafter\endgroup
+ \x{luatexbase-attr}{LuaTeX is required for this package. Aborting.}
+ \lltxb@attr@AtEnd
+ \expandafter\endinput
+\fi
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input luatexbase-compat.sty
+\else
+ \RequirePackage{luatexbase-compat}
+\fi
+\luatexbase@ensure@primitive{luaescapestring}
+\luatexbase@ensure@primitive{attributedef}
+\luatexbase@ensure@primitive{attribute}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input luatexbase-loader.sty
+\else
+ \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
+ \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}
+\def\setluatexattribute#1#2{%
+ #1=\numexpr#2\relax}
+\lltxb@attr@AtEnd
+\endinput
+%%
+%% End of file `luatexbase-attr.sty'.