summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3token.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3token.dtx65
1 files changed, 48 insertions, 17 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
index 3c5ba351913..151901bd2dd 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3names}
-\GetIdInfo$Id: l3token.dtx 3316 2012-02-06 12:24:43Z bruno $
+\GetIdInfo$Id: l3token.dtx 3460 2012-02-26 12:16:41Z will $
{L3 Experimental token manipulation}
%</driver|package>
%<*driver>
@@ -172,7 +172,7 @@
%
% \begin{function}{\char_set_catcode:nn}
% \begin{syntax}
-% \cs{char_set_catcode:nn} \Arg{intexpr1} \Arg{intexpr2}
+% \cs{char_set_catcode:nn} \Arg{intexpr_1} \Arg{intexpr_2}
% \end{syntax}
% These functions set the category code of the \meta{character} which
% has character code as given by the \meta{integer expression}.
@@ -203,7 +203,7 @@
%
% \begin{function}{\char_set_lccode:nn}
% \begin{syntax}
-% \cs{char_set_lcode:nn} \Arg{intexpr1} \Arg{intexpr2}
+% \cs{char_set_lcode:nn} \Arg{intexpr_1} \Arg{intexpr_2}
% \end{syntax}
% This function set up the behaviour of \meta{character} when
% found inside \cs{tl_to_lowercase:n}, such that \meta{character1}
@@ -240,7 +240,7 @@
%
% \begin{function}{\char_set_uccode:nn}
% \begin{syntax}
-% \cs{char_set_uccode:nn} \Arg{intexpr1} \Arg{intexpr2}
+% \cs{char_set_uccode:nn} \Arg{intexpr_1} \Arg{intexpr_2}
% \end{syntax}
% This function set up the behaviour of \meta{character} when
% found inside \cs{tl_to_uppercase:n}, such that \meta{character1}
@@ -277,7 +277,7 @@
%
% \begin{function}{\char_set_mathcode:nn}
% \begin{syntax}
-% \cs{char_set_mathcode:nn} \Arg{intexpr1} \Arg{intexpr2}
+% \cs{char_set_mathcode:nn} \Arg{intexpr_1} \Arg{intexpr_2}
% \end{syntax}
% This function sets up the math code of \meta{character}.
% The \meta{character} is specified as
@@ -306,7 +306,7 @@
%
% \begin{function}{\char_set_sfcode:nn}
% \begin{syntax}
-% \cs{char_set_sfcode:nn} \Arg{intexpr1} \Arg{intexpr2}
+% \cs{char_set_sfcode:nn} \Arg{intexpr_1} \Arg{intexpr_2}
% \end{syntax}
% This function sets up the space factor for the \meta{character}.
% The \meta{character} is specified as
@@ -332,14 +332,14 @@
% character code given by the \meta{integer expression} on the
% terminal.
% \end{function}
-%
+%
% \begin{variable}[added = 2012-01-23]{\l_char_active_seq}
% Used to track which tokens will require special handling at the document
% level as they are of category \meta{active} (catcode~$13$). Each entry in
% the sequence consists of a single active character. Active tokens should be
% added to the sequence when they are defined for general document use.
% \end{variable}
-%
+%
% \begin{variable}[added = 2012-01-23]{\l_char_special_seq}
% Used to track which tokens will require special handling when working with
% verbatim-like material at the document level as they are not of categories
@@ -354,7 +354,7 @@
%
% \begin{function}{\token_new:Nn}
% \begin{syntax}
-% \cs{token_new:Nn} \meta{token1} \Arg{token2}
+% \cs{token_new:Nn} \meta{token1} \Arg{token_2}
% \end{syntax}
% Defines \meta{token1} to globally be a snapshot of \meta{token2}.
% This will be an implicit representation of \meta{token2}.
@@ -652,6 +652,14 @@
% \end{texnote}
% \end{function}
%
+% \begin{function}[EXP,pTF, added=2012-02-15]{\token_if_muskip_register:N}
+% \begin{syntax}
+% \cs{token_if_muskip_register_p:N} \meta{token} \\
+% \cs{token_if_muskip_register:NTF} \meta{token} \Arg{true code} \Arg{false code}
+% \end{syntax}
+% Tests if the \meta{token} is defined to be a muskip register.
+% \end{function}
+%
% \begin{function}[EXP,pTF, updated=2012-01-20]{\token_if_skip_register:N}
% \begin{syntax}
% \cs{token_if_skip_register_p:N} \meta{token} \\
@@ -947,7 +955,7 @@
% made active within the current \TeX{} group level, and the definition
% is also local.
% \end{function}
-%
+%
% \begin{function}[added = 2011-12-27]
% {\char_gset_active:Npn, \char_gset_active:Npx}
% \begin{syntax}
@@ -973,7 +981,7 @@
% is made active within the current \TeX{} group level, and the definition
% is also local.
% \end{function}
-%
+%
% \begin{function}[added = 2011-12-27]
% {\char_gset_active_eq:NN}
% \begin{syntax}
@@ -1256,7 +1264,7 @@
\group_end:
% \end{macrocode}
% \end{variable}
-%
+%
% \begin{variable}{\l_char_active_seq, \l_char_special_seq}
% Two sequences for dealing with special characters. The first is characters
% which may be active, and contains the active characters themselves to
@@ -1264,8 +1272,8 @@
% characters more generally, and these are escaped so that for example
% bulk code assignments can be carried out. In both cases, the order is
% by \textsc{ascii} character code (as is done in for example
-% \cs{ExplSyntaxOn}). The only complication is dealing with |_|, which has to
-% be done using \cs{tl_to_lowercase:n}
+% \cs{ExplSyntaxOn}). The only complication is dealing with |_|, which
+% requires the use of \cs{use:n} \emph{and} \cs{use:nn}.
% \begin{macrocode}
\seq_new:N \l_char_active_seq
\use:n
@@ -1283,7 +1291,7 @@
\seq_set_from_clist:Nn \l_char_active_seq
}
}
- { { " , $ , & , ^ , _ , ~ } }
+ { { " , $ , & , ^ , _ , ~ } } %$
\seq_new:N \l_char_special_seq
\seq_set_from_clist:Nn \l_char_special_seq
{ \ , \" , \# , \$ , \% , \& , \\ , \^ , \_ , \{ , \} , \~ }
@@ -1324,7 +1332,7 @@
{
\if_catcode:w \exp_not:N #1 \c_math_toggle_token
\prg_return_true: \else: \prg_return_false: \fi:
- }
+ }
% \end{macrocode}
% \end{macro}
%
@@ -1555,6 +1563,7 @@
% {
% \token_if_chardef:N, \token_if_mathchardef:N,
% \token_if_dim_register:N, \token_if_int_register:N,
+% \token_if_muskip_register:N,
% \token_if_skip_register:N, \token_if_toks_register:N,
% \token_if_long_macro:N,
% \token_if_protected_macro:N, \token_if_protected_long_macro:N,
@@ -1564,6 +1573,7 @@
% \token_if_chardef_aux:w,
% \token_if_dim_register_aux:w,
% \token_if_int_register_aux:w,
+% \token_if_muskip_register_aux:w,
% \token_if_skip_register_aux:w,
% \token_if_toks_register_aux:w,
% \token_if_protected_macro_aux:w,
@@ -1674,7 +1684,28 @@
}
\cs_new:Npn \token_if_int_register_aux:w #1 COUXY #2 \q_stop { #1 ~ }
% \end{macrocode}
-% Skip registers are done the same way as the dimension registers.
+% Muskip registers are done the same way as the dimension registers.
+% \begin{macrocode}
+ \prg_new_conditional:Npnn \token_if_muskip_register:N #1 { p , T , F , TF }
+ {
+ \if_meaning:w \tex_muskip:D #1
+ \prg_return_false:
+ \else:
+ \if_meaning:w \tex_muskipdef:D #1
+ \prg_return_false:
+ \else:
+ \str_if_eq_return:xx
+ {
+ \exp_after:wN \token_if_muskip_register_aux:w
+ \token_to_meaning:N #1 MUSKIP \q_stop
+ }
+ { \token_to_str:N \ }
+ \fi:
+ \fi:
+ }
+ \cs_new:Npn \token_if_muskip_register_aux:w #1 MUSKIP #2 \q_stop { #1 ~ }
+% \end{macrocode}
+% Skip registers.
% \begin{macrocode}
\prg_new_conditional:Npnn \token_if_skip_register:N #1 { p , T , F , TF }
{