diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/luatex.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/luatex.dtx | 177 |
1 files changed, 115 insertions, 62 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/luatex.dtx b/Master/texmf-dist/source/latex/oberdiek/luatex.dtx index 17346c9efbe..d038a92ca83 100644 --- a/Master/texmf-dist/source/latex/oberdiek/luatex.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/luatex.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2007, 2009 by +% Copyright (C) 2007, 2009, 2010 by % Heiko Oberdiek <heiko.oberdiek at googlemail.com> % % This work may be distributed and/or modified under the @@ -83,7 +83,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luatex 2009/12/02 v0.3 LuaTeX basic definition package (HO)} +\Msg{* Package: luatex 2010/03/09 v0.4 LuaTeX basic definition package (HO)} \Msg{************************************************************************} \keepsilent @@ -94,7 +94,7 @@ This is a generated file. -Copyright (C) 2007, 2009 by +Copyright (C) 2007, 2009, 2010 by Heiko Oberdiek <heiko.oberdiek at googlemail.com> This work may be distributed and/or modified under the @@ -175,7 +175,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luatex.drv}% - [2009/12/02 v0.3 LuaTeX basic definition package (HO)]% + [2010/03/09 v0.4 LuaTeX basic definition package (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2008/08/11] \usepackage{paralist} @@ -185,7 +185,7 @@ and the derived files %</driver> % \fi % -% \CheckSum{1237} +% \CheckSum{1341} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -206,7 +206,7 @@ and the derived files % \GetFileInfo{luatex.drv} % % \title{The \xpackage{luatex} package} -% \date{2009/12/02 v0.3} +% \date{2010/03/09 v0.4} % \author{Heiko Oberdiek\\\xemail{heiko.oberdiek at googlemail.com}} % % \maketitle @@ -303,13 +303,6 @@ and the derived files % registers below 256 are stored in an array and higher numbers % are put in a tree structure. % -% \subsection{Lua states} -% -% \begin{declcs}{newluastate} \M{cmd} -% \end{declcs} -% Macro \cs{newluastate} reserves a new Lua state and stores -% the number in \cs{cmd}. -% % \subsection{Attributes} % % Nodes can have custom attributes in \LuaTeX. These attributes @@ -562,7 +555,7 @@ and the derived files \fi \expandafter\x\csname ver@luatex.sty\endcsname \ProvidesPackage{luatex}% - [2009/12/02 v0.3 LuaTeX basic definition package (HO)] + [2010/03/09 v0.4 LuaTeX basic definition package (HO)] % \end{macrocode} % % \subsection{Catcodes} @@ -634,6 +627,85 @@ and the derived files \fi % \end{macrocode} % +% \subsection{Provide Lua\TeX\ primitives} +% +% \begin{macrocode} +\ifnum\luatexversion<36 % + \def\LuT@MakePrimitive#1{% + \expandafter\let\csname luatex#1\expandafter\endcsname + \csname #1\endcsname + }% +\else + \def\LuT@MakeLuatexPrimitive#1{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname luatex#1\endcsname\relax + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname #1\endcsname\relax + \else + \expandafter\let + \csname luatex#1\expandafter\endcsname + \csname #1\endcsname + \fi + \fi + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname luatex#1\endcsname\relax + \begingroup + \expandafter\let\csname luatex#1\endcsname\@undefined + \ifnum0% + \directlua{% + if tex.enableprimitives then % + tex.enableprimitives('luatex',{'#1'})% + tex.print('1')% + end% + }% + \expandafter\ifx\csname luatex#1\endcsname\relax\else1\fi + =11 % + \global\expandafter\let + \csname luatex#1\expandafter\endcsname + \csname luatex#1\endcsname + \else + \@PackageError{luatex}{% + tex.enableprimitives failed for `#1'% + }\@ehc + \fi + \endgroup + \fi + }% + \def\LuT@MakePrimitive#1{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname#1\endcsname\relax + \begingroup + \expandafter\let\csname#1\endcsname\@undefined + \ifnum0% + \directlua{% + if tex.enableprimitives then % + tex.enableprimitives('',{'#1'})% + tex.print('1')% + end% + }% + \expandafter\ifx\csname#1\endcsname\relax\else1\fi + =11 % + \global\expandafter\let + \csname#1\expandafter\endcsname + \csname#1\endcsname + \else + \@PackageError{luatex}{% + tex.enableprimitives failed for `#1'% + }\@ehc + \fi + \endgroup + \fi + }% +\fi +\LuT@MakeLuatexPrimitive{attribute} +\LuT@MakeLuatexPrimitive{attributedef} +\LuT@MakeLuatexPrimitive{catcodetable} +\LuT@MakeLuatexPrimitive{initcatcodetable} +\LuT@MakeLuatexPrimitive{luaescapestring} +\LuT@MakeLuatexPrimitive{savecatcodetable} +\LuT@MakePrimitive{numexpr} +% \end{macrocode} +% % \subsection{Inherit support for \eTeX} % % Package \xpackage{etex} is not compatible for \plainTeX. @@ -841,31 +913,6 @@ and the derived files % \end{macrocode} % \end{macro} % -% \subsection{Lua states} -% -% \begin{macro}{\LuT@AllocLuaState} -% \begin{macrocode} -\newcount\LuT@AllocLuaState -\LuT@AllocLuaState=\z@ -% \end{macrocode} -% \end{macro} -% \begin{macro}{\newluastate} -% \begin{macrocode} -\LuT@newcommand\newluastate[1]{% - \ifnum\LuT@AllocLuaState<65535 % - \global\advance\LuT@AllocLuaState\@ne - \allocationnumber\LuT@AllocLuaState - \global\chardef#1=\allocationnumber - \wlog{\string#1=\string\luastate\the\allocationnumber}% - \else - \errmessage{No room for a new \string\luastate}% - \fi -} -% \end{macrocode} -% \end{macro} -% -% -% % \subsection{Attributes} % % \subsubsection{Allocation} @@ -882,7 +929,7 @@ and the derived files \ifnum\LuT@AllocAttribute<65535 % \global\advance\LuT@AllocAttribute\@ne \allocationnumber\LuT@AllocAttribute - \global\attributedef#1=\allocationnumber + \global\luatexattributedef#1=\allocationnumber \unsetattribute{#1}% \wlog{\string#1=\string\attribute\the\allocationnumber}% \else @@ -1007,11 +1054,11 @@ and the derived files % \end{macrocode} % % \begin{macrocode} -\initcatcodetable\CatcodeTableIniTeX +\luatexinitcatcodetable\CatcodeTableIniTeX \begingroup \def\@makeother#1{\catcode#1=12\relax}% \@firstofone{% - \catcodetable\CatcodeTableIniTeX + \luatexcatcodetable\CatcodeTableIniTeX \begingroup \SetCatcodeRange{0}{8}{15}% \catcode9=10 % tab @@ -1027,7 +1074,7 @@ and the derived files \catcode125=2 % brace right \catcode126=13 % tilde \catcode127=15 % - \savecatcodetable\CatcodeTableLaTeX + \luatexsavecatcodetable\CatcodeTableLaTeX \endgroup \@makeother{0}% nul \@makeother{13}% carriage return @@ -1036,9 +1083,9 @@ and the derived files \@makeother{127}% \SetCatcodeRange{65}{90}{12}% A-Z \SetCatcodeRange{97}{122}{12}% a-z - \savecatcodetable\CatcodeTableString + \luatexsavecatcodetable\CatcodeTableString \@makeother{32}% space - \savecatcodetable\CatcodeTableOther + \luatexsavecatcodetable\CatcodeTableOther \endgroup }% % \end{macrocode} @@ -1060,7 +1107,7 @@ and the derived files % \begin{macrocode} \LuT@newcommand\PushCatcodeTableNumStack[0]{% \xdef\LuT@NumStack{% - {\the\catcodetable}\LuT@NumStack + {\the\luatexcatcodetable}\LuT@NumStack }% } % \end{macrocode} @@ -1070,9 +1117,9 @@ and the derived files \LuT@newcommand\PopCatcodeTableNumStack[0]{% \ifx\LuT@NumStack\LuT@NumStackEmpty \@PackageWarning{luatex}{Empty catcode table number stack}% - \catcodetable\z@ + \luatexcatcodetable\z@ \else - \catcodetable=\expandafter\@car\LuT@NumStack\@nil\relax + \luatexcatcodetable=\expandafter\@car\LuT@NumStack\@nil\relax \xdef\LuT@NumStack{% \expandafter\@cdr\LuT@NumStack\@nil }% @@ -1087,10 +1134,10 @@ and the derived files % \begin{macrocode} \LuT@newcommand\BeginCatcodeRegime[1]{% \PushCatcodeTableNumStack - \catcodetable=\numexpr#1\relax + \luatexcatcodetable=\numexpr#1\relax \IncCatcodeTableStack - \savecatcodetable\CatcodeTableStack - \catcodetable\CatcodeTableStack + \luatexsavecatcodetable\CatcodeTableStack + \luatexcatcodetable\CatcodeTableStack } % \end{macrocode} % \end{macro} @@ -1111,7 +1158,7 @@ and the derived files \expandafter\ifx\csname RequirePackage\endcsname\relax \input luatex-loader.sty\relax \else - \RequirePackage{luatex-loader}[2009/12/02]% + \RequirePackage{luatex-loader}[2010/03/09]% \fi % \end{macrocode} % \begin{macrocode} @@ -1188,7 +1235,7 @@ and the derived files \fi \expandafter\x\csname ver@luatex-loader.sty\endcsname \ProvidesPackage{luatex-loader}% - [2009/12/02 v0.3 Lua module loader (HO)] + [2010/03/09 v0.4 Lua module loader (HO)] % \end{macrocode} % \begin{macrocode} \begingroup @@ -1274,7 +1321,7 @@ table.insert(package.loaders, kpse_module_loader) %<*test2> \documentclass{article} \def\LoadCommand{% - \RequirePackage{luatex}[2009/12/02]% + \RequirePackage{luatex}[2010/03/09]% } %</test2> % \end{macrocode} @@ -1282,7 +1329,7 @@ table.insert(package.loaders, kpse_module_loader) %<*test3> \documentclass{article} \def\LoadCommand{% - \RequirePackage{luatex-loader}[2009/12/02]% + \RequirePackage{luatex-loader}[2010/03/09]% } %</test3> % \end{macrocode} @@ -1393,7 +1440,7 @@ table.insert(package.loaders, kpse_module_loader) \advance\count0 by 1 % \repeat \documentclass{minimal} -\usepackage{luatex}[2009/12/02] +\usepackage{luatex}[2010/03/09] \usepackage{qstest} \IncludeTests{*} \LogTests{log}{*}{*} @@ -1405,7 +1452,7 @@ table.insert(package.loaders, kpse_module_loader) \newcount\scratch \def\Test#1#2{% \begin{qstest}{CatcodeTable#1}{CatcodeTable#1}% - \catcodetable\csname CatcodeTable#1\endcsname + \luatexcatcodetable\csname CatcodeTable#1\endcsname \count@=\z@ \loop \scratch=#2\relax @@ -1419,11 +1466,11 @@ table.insert(package.loaders, kpse_module_loader) \Test{LaTeX}{\the\count\numexpr\TestLaTeX+\count@} \Test{String}{\ifnum\count@=32 10\else 12\fi} \Test{Other}{12} -\initcatcodetable99 % +\luatexinitcatcodetable99 % \Test{IniTeX}{% 0\relax \begingroup - \catcodetable99 % + \luatexcatcodetable99 % \global\scratch=\the\catcode\count@ \endgroup } @@ -1441,8 +1488,8 @@ table.insert(package.loaders, kpse_module_loader) \TestStack{{0}0}% \@firstofone{% \begingroup - \initcatcodetable12 % - \catcodetable12 % + \luatexinitcatcodetable12 % + \luatexcatcodetable12 % \PushCatcodeTableNumStack \TestStack{{12}{0}0}% \PopCatcodeTableNumStack @@ -1502,7 +1549,7 @@ table.insert(package.loaders, kpse_module_loader) % \begin{macrocode} \begin{qstest}{CatcodeRegime}{CatcodeRegime} \def\TestStacks#1#2#3{% - \Expect*{\the\catcodetable}{#1}% + \Expect*{\the\luatexcatcodetable}{#1}% \Expect*{\the\CatcodeTableStack}{#2}% \Expect*{\LuT@NumStack}{#3}% }% @@ -1790,6 +1837,12 @@ table.insert(package.loaders, kpse_module_loader) % \item % Unsetting of attributes updated for \LuaTeX\ 0.37. % \end{Version} +% \begin{Version}{2010/03/09 v0.4} +% \item +% Support for lua states removed. +% \item +% Calling tex.enableprimitives for used primitives. +% \end{Version} % \end{History} % % \PrintIndex |