diff options
author | Karl Berry <karl@freefriends.org> | 2011-09-16 22:35:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-09-16 22:35:41 +0000 |
commit | 6d95b4a2c1bbdaea1a3802c822808f476ac5703b (patch) | |
tree | 1abf9117bf53f2de53fbcc62c352acc92780365b /Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx | |
parent | b7f762397f5df2d732326713423e31e1bf91b903 (diff) |
l3kernel 2828 (15sep11)
git-svn-id: svn://tug.org/texlive/trunk@23983 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx | 107 |
1 files changed, 53 insertions, 54 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx index b2f12568bb1..12110fb86c2 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx @@ -9,7 +9,7 @@ %% %% http://www.latex-project.org/lppl.txt %% -%% This file is part of the "expl3 bundle" (The Work in LPPL) +%% This file is part of the "l3kernel bundle" (The Work in LPPL) %% and all files in that bundle must be distributed together. %% %% The released version of this bundle is available from CTAN. @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3names} -\GetIdInfo$Id: l3luatex.dtx 2617 2011-08-18 08:13:44Z joseph $ +\GetIdInfo$Id: l3luatex.dtx 2798 2011-09-10 15:42:13Z will $ {L3 Experimental LuaTeX-specific functions} %</driver|package> %<*driver> @@ -69,26 +69,26 @@ % % \section{Breaking out to \Lua{}} % -% The \LuaTeX{} engine provides access to the \Lua{} programming language, -% and with it access to the \enquote{internals} of \TeX{}. In order to use +% The \LuaTeX{} engine provides access to the \Lua{} programming language, +% and with it access to the \enquote{internals} of \TeX{}. In order to use % this within the framework provided here, a family of functions is % available. When used with \pdfTeX{} or \XeTeX{} these will raise an % error: use \cs{luatex_if_engine:T} to avoid this. Details of coding % the \LuaTeX{} engine are detailed in the \LuaTeX{} manual. -% +% % \begin{function}[EXP]{\lua_now:n, \lua_now:x} % \begin{syntax} % \cs{lua_now:n} \Arg{token list} % \end{syntax} % The \meta{token list} is first tokenized by \TeX{}, which will include % converting line ends to spaces in the usual \TeX{} manner and which -% respects currently-applicable \TeX\ category codes. The resulting +% respects currently-applicable \TeX\ category codes. The resulting % \meta{\Lua{} input} is passed to the \Lua{} interpreter for processing. % Each \cs{lua_now:n} block is treated by \Lua{} as a separate chunk. -% The \Lua{} interpreter will execute the \meta{\Lua{} input} immediately, +% The \Lua{} interpreter will execute the \meta{\Lua{} input} immediately, % and in an expandable manner. % \begin{texnote} -% \cs{lua_now:x} is the \LuaTeX{} primitive \cs{directlua} renamed. +% \cs{lua_now:x} is the \LuaTeX{} primitive \tn{directlua} renamed. % \end{texnote} % \end{function} % @@ -98,15 +98,15 @@ % \end{syntax} % The \meta{token list} is first tokenized by \TeX{}, which will include % converting line ends to spaces in the usual \TeX{} manner and which -% respects currently-applicable \TeX{} category codes. The resulting -% \meta{\Lua{} input} is passed to the \Lua\ interpreter when the +% respects currently-applicable \TeX{} category codes. The resulting +% \meta{\Lua{} input} is passed to the \Lua\ interpreter when the % current page is finalised (\emph{i.e.}~at shipout). Each % \cs{lua_shipout:n} block is treated by \Lua{} as a separate chunk. % The \Lua{} interpreter will execute the \meta{\Lua{} input} during the % page-building routine: no \TeX{} expansion of the \meta{\Lua{} input} % will occur at this stage. % \begin{texnote} -% At a \TeX{} level, the \meta{\Lua{} input} is stored as a +% At a \TeX{} level, the \meta{\Lua{} input} is stored as a % \enquote{whatsit}. % \end{texnote} % \end{function} @@ -117,8 +117,8 @@ % \end{syntax} % The \meta{token list} is first tokenized by \TeX{}, which will include % converting line ends to spaces in the usual \TeX{} manner and which -% respects currently-applicable \TeX{} category codes. The resulting -% \meta{\Lua{} input} is passed to the \Lua{} interpreter when the +% respects currently-applicable \TeX{} category codes. The resulting +% \meta{\Lua{} input} is passed to the \Lua{} interpreter when the % current page is finalised (\emph{i.e.}~at shipout). Each % \cs{lua_shipout:n} block is treated by \Lua{} as a separate chunk. % The \Lua{} interpreter will execute the \meta{\Lua{} input} during the @@ -127,10 +127,10 @@ % makes these functions suitable for including material finalised % during the page building process (such as the page number). % \begin{texnote} -% \cs{lua_shipout_x:n} is the \LuaTeX{} primitive \cs{latelua} +% \cs{lua_shipout_x:n} is the \LuaTeX{} primitive \tn{latelua} % named using the \LaTeX3 scheme. -% -% At a \TeX{} level, the \meta{\Lua{} input} is stored as a +% +% At a \TeX{} level, the \meta{\Lua{} input} is stored as a % \enquote{whatsit}. % \end{texnote} % \end{function} @@ -138,13 +138,13 @@ % \section{Category code tables} % % As well as providing methods to break out into \Lua{}, there are -% places where additional \LaTeX3 functions are provided by the -% \LuaTeX{} engine. In particular, \LuaTeX{} provides category code +% places where additional \LaTeX3 functions are provided by the +% \LuaTeX{} engine. In particular, \LuaTeX{} provides category code % tables. These can be used to ensure that a set of category codes -% are in force in a more robust way than is possible with other +% are in force in a more robust way than is possible with other % engines. These are therefore used by \cs{ExplSyntaxOn} and % \pkg{ExplSyntaxOff} when using the \LuaTeX{} engine. -% +% % \begin{function}{\cctab_new:N} % \begin{syntax} % \cs{cctab_new:N} \meta{category code table} @@ -155,8 +155,7 @@ % % \begin{function}{\cctab_gset:Nn} % \begin{syntax} -% \cs{cctab_gset:Nn} \meta{category code table} -% \Arg{category code set up} +% \cs{cctab_gset:Nn} \meta{category code table} \Arg{category code set up} % \end{syntax} % Sets the \meta{category code table} to apply the category codes % which apply when the prevailing regime is modified by the @@ -165,13 +164,13 @@ % The assignment of the table is global: the underlying primitive does % not respect grouping. % \end{function} -% +% % \begin{function}{\cctab_begin:N} % \begin{syntax} % \cs{cctab_begin:N} \meta{category code table} % \end{syntax} % Switches the category codes in force to those stored in the -% \meta{category code table}. The prevailing codes before the +% \meta{category code table}. The prevailing codes before the % function is called are added to a stack, for use with % \cs{cctab_end:}. % \end{function} @@ -192,8 +191,8 @@ % \end{variable} % % \begin{variable}{\c_document_cctab} -% Category code table for a standard \LaTeX{} document. This does not -% include setting the behaviour of the line-end character, which is +% Category code table for a standard \LaTeX{} document. This does not +% include setting the behaviour of the line-end character, which is % only altered by \cs{ExplSyntaxOff}. % \end{variable} % @@ -217,11 +216,11 @@ % \begin{implementation} % % \section{\pkg{l3luatex} implementation} -% +% % \begin{macrocode} %<*initex|package> % \end{macrocode} -% +% % Announce and ensure that the required packages are loaded. % \begin{macrocode} %<*package> @@ -230,7 +229,7 @@ \package_check_loaded_expl: %</package> % \end{macrocode} -% +% % \begin{macro}{\lua_now:n, \lua_now:x} % \begin{macro}{\lua_shipout_x:n, \lua_shipout_x:x} % \begin{macro}{\lua_shipout:n, \lua_shipout:x} @@ -273,7 +272,7 @@ % \begin{variable}{\g_cctab_allocate_int} % \begin{variable}{\g_cctab_stack_int} % \begin{variable}{\g_cctab_stack_seq} -% To allocate category code tables, both the read-only and stack +% To allocate category code tables, both the read-only and stack % tables need to be followed. There is also a sequence stack for the % dynamic tables themselves. % \begin{macrocode} @@ -283,13 +282,13 @@ \seq_new:N \g_cctab_stack_seq % \end{macrocode} % \end{variable} -% \end{variable} -% \end{variable} +% \end{variable} +% \end{variable} % % \begin{macro}{\cctab_new:N} % Creating a new category code table is done slightly differently % from other registers. Low-numbered tables are more efficiently-stored -% than high-numbered ones. There is also a need to have a stack of +% than high-numbered ones. There is also a need to have a stack of % flexible tables as well as the set of read-only ones. To satisfy both % of these requirements, odd numbered tables are used for read-only % tables, and even ones for the stack. Here, therefore, the odd numbers @@ -298,28 +297,28 @@ \cs_new_protected_nopar:Npn \cctab_new:N #1 { \cs_if_free:NTF #1 - { + { \int_gadd:Nn \g_cctab_allocate_int { 2 } - \int_compare:nNnTF + \int_compare:nNnTF { \g_cctab_allocate_int } < { \c_max_register_int + 1 } - { - \pref_global:D \tex_mathchardef:D #1 \g_cctab_allocate_int + { + \tex_global:D \tex_mathchardef:D #1 \g_cctab_allocate_int \luatex_initcatcodetable:D #1 } - { \msg_kernel_fatal:nnx { alloc } { out-of-registers } { cctab } } + { \msg_kernel_fatal:nnx { alloc } { out-of-registers } { cctab } } } { - \msg_kernel_error:nnx { code } { variable-already-defined } - { \token_to_str:N #1 } + \msg_kernel_error:nnx { code } { variable-already-defined } + { \token_to_str:N #1 } } - } + } \luatex_if_engine:F { \cs_set_protected_nopar:Npn \cctab_new:N #1 { \lua_wrong_engine: } } %<*package> \luatex_if_engine:T { - \cs_set_protected_nopar:Npn \cctab_new:N #1 - { + \cs_set_protected_nopar:Npn \cctab_new:N #1 + { \newcatcodetable #1 \luatex_initcatcodetable:D #1 } @@ -342,8 +341,8 @@ \int_gadd:Nn \g_cctab_stack_int { 2 } \int_compare:nNnT { \g_cctab_stack_int } > { 268 435 453 } { \msg_kernel_error:nn { code } { cctab-stack-full } } - \luatex_savecatcodetable:D \g_cctab_stack_int - \luatex_catcodetable:D \g_cctab_stack_int + \luatex_savecatcodetable:D \g_cctab_stack_int + \luatex_catcodetable:D \g_cctab_stack_int } \cs_new_protected_nopar:Npn \cctab_end: { @@ -397,7 +396,7 @@ % The \texttt{other} and \texttt{string} ones are done by completely % ignoring the existing codes as this makes life a lot less complex. The % table for \pkg{expl3} category codes is always needed, whereas when in -% package mode the rest can be copied from the existing \LaTeXe{} package +% package mode the rest can be copied from the existing \LaTeXe{} package % \pkg{luatex}. % \begin{macrocode} \luatex_if_engine:T @@ -405,7 +404,7 @@ \cctab_new:N \c_code_cctab \cctab_gset:Nn \c_code_cctab { } } -%<*package> +%<*package> \luatex_if_engine:T { \cs_new_eq:NN \c_document_cctab \CatcodeTableLaTeX @@ -413,8 +412,8 @@ \cs_new_eq:NN \c_other_cctab \CatcodeTableOther \cs_new_eq:NN \c_string_cctab \CatcodeTableString } -%</package> -%<*initex> +%</package> +%<*initex> \luatex_if_engine:T { \cctab_new:N \c_document_cctab @@ -432,13 +431,13 @@ { \prg_stepwise_inline:nnnn { 0 } { 1 } { 127 } { \char_set_catcode_other:n {#1} } - } + } \cctab_gset:Nn \c_string_cctab { \prg_stepwise_inline:nnnn { 0 } { 1 } { 127 } { \char_set_catcode_other:n {#1} } - \char_set_catcode_space:n { 32 } - } + \char_set_catcode_space:n { 32 } + } } %</initex> % \end{macrocode} @@ -447,11 +446,11 @@ % \end{variable} % \end{variable} % \end{variable} -% +% % \begin{macrocode} %</initex|package> % \end{macrocode} % %\end{implementation} % -%\PrintIndex
\ No newline at end of file +%\PrintIndex |