summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/expl3/l3expan.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/expl3/l3expan.sty')
-rw-r--r--Master/texmf-dist/tex/latex/expl3/l3expan.sty81
1 files changed, 50 insertions, 31 deletions
diff --git a/Master/texmf-dist/tex/latex/expl3/l3expan.sty b/Master/texmf-dist/tex/latex/expl3/l3expan.sty
index 6ee4c4d805f..cbe31dd98b5 100644
--- a/Master/texmf-dist/tex/latex/expl3/l3expan.sty
+++ b/Master/texmf-dist/tex/latex/expl3/l3expan.sty
@@ -48,7 +48,7 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
-\GetIdInfo$Id: l3expan.dtx 1673 2009-11-02 05:40:42Z will $
+\GetIdInfo$Id: l3expan.dtx 1873 2010-03-24 08:32:54Z joseph $
{L3 Experimental Argument Expansion module}
\ProvidesExplPackage
{\filename}{\filedate}{\fileversion}{\filedescription}
@@ -79,19 +79,10 @@
{#1}{#2}
}
\cs_new_nopar:Npn \exp_stop_f: {~}
-%%\cs_new_eq:NN \exp_arg:x \expanded % Move eventually.
-%%\cs_if_free:NTF\exp_arg:x{
- \cs_new:Npn \::x #1 \::: #2#3 {
+ \cs_new_protected:Npn \::x #1 \::: #2#3 {
\cs_set_nopar:Npx \l_exp_tl {{#3}}
\exp_after:wN \exp_arg_next:nnn \l_exp_tl {#1}{#2}
}
-%%}
-%%{
-%% \cs_new:Npn\::x#1\:::#2#3{
-%% \exp_after:wN\exp_arg_next:nnn
-%% \exp_after:wN{\exp_arg:x{#3}}{#1}{#2}
-%% }
-%%}
\cs_new:Npn \::V#1\:::#2#3{
\exp_after:wN\exp_arg_next:nnn
\exp_after:wN{
@@ -146,54 +137,51 @@
\cs_set_nopar:Npn \exp_args:Nf {\::f\:::}
\cs_set_nopar:Npn \exp_args:Nv {\::v\:::}
\cs_set_nopar:Npn \exp_args:NV {\::V\:::}
-\cs_set_nopar:Npn \exp_args:Nx {\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:Nx {\::x\:::}
\cs_set_nopar:Npn \exp_args:NNf {\::N\::f\:::}
\cs_set_nopar:Npn \exp_args:NNv {\::N\::v\:::}
\cs_set_nopar:Npn \exp_args:NNV {\::N\::V\:::}
-\cs_set_nopar:Npn \exp_args:NNx {\::N\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:NNx {\::N\::x\:::}
-\cs_set_nopar:Npn \exp_args:Ncx {\::c\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:Ncx {\::c\::x\:::}
\cs_set_nopar:Npn \exp_args:Nfo {\::f\::o\:::}
\cs_set_nopar:Npn \exp_args:Nff {\::f\::f\:::}
\cs_set_nopar:Npn \exp_args:Ncf {\::c\::f\:::}
\cs_set_nopar:Npn \exp_args:Nnf {\::n\::f\:::}
\cs_set_nopar:Npn \exp_args:Nno {\::n\::o\:::}
\cs_set_nopar:Npn \exp_args:NnV {\::n\::V\:::}
-\cs_set_nopar:Npn \exp_args:Nnx {\::n\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:Nnx {\::n\::x\:::}
\cs_set_nopar:Npn \exp_args:Noc {\::o\::c\:::}
\cs_set_nopar:Npn \exp_args:Noo {\::o\::o\:::}
-\cs_set_nopar:Npn \exp_args:Nox {\::o\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:Nox {\::o\::x\:::}
\cs_set_nopar:Npn \exp_args:NVV {\::V\::V\:::}
-\cs_set_nopar:Npn \exp_args:Nxo {\::x\::o\:::}
-\cs_set_nopar:Npn \exp_args:Nxx {\::x\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:Nxo {\::x\::o\:::}
+\cs_set_protected_nopar:Npn \exp_args:Nxx {\::x\::x\:::}
\cs_set_nopar:Npn \exp_args:NNNV {\::N\::N\::V\:::}
\cs_set_nopar:Npn \exp_args:NNno {\::N\::n\::o\:::}
-\cs_set_nopar:Npn \exp_args:NNnx {\::N\::n\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:NNnx {\::N\::n\::x\:::}
\cs_set_nopar:Npn \exp_args:NNoo {\::N\::o\::o\:::}
-\cs_set_nopar:Npn \exp_args:NNox {\::N\::o\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:NNox {\::N\::o\::x\:::}
\cs_set_nopar:Npn \exp_args:Nnnc {\::n\::n\::c\:::}
\cs_set_nopar:Npn \exp_args:Nnno {\::n\::n\::o\:::}
-\cs_set_nopar:Npn \exp_args:Nnnx {\::n\::n\::x\:::}
-\cs_set_nopar:Npn \exp_args:Nnox {\::n\::o\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:Nnnx {\::n\::n\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:Nnox {\::n\::o\::x\:::}
\cs_set_nopar:Npn \exp_args:NcNc {\::c\::N\::c\:::}
\cs_set_nopar:Npn \exp_args:NcNo {\::c\::N\::o\:::}
\cs_set_nopar:Npn \exp_args:Ncco {\::c\::c\::o\:::}
\cs_set_nopar:Npn \exp_args:Ncco {\::c\::c\::o\:::}
-\cs_set_nopar:Npn \exp_args:Nccx {\::c\::c\::x\:::}
-\cs_set_nopar:Npn \exp_args:Ncnx {\::c\::n\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:Nccx {\::c\::c\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:Ncnx {\::c\::n\::x\:::}
-\cs_set_nopar:Npn \exp_args:Noox {\::o\::o\::x\:::}
+\cs_set_protected_nopar:Npn \exp_args:Noox {\::o\::o\::x\:::}
\cs_set_nopar:Npn \exp_args:Nooo {\::o\::o\::o\:::}
\cs_new:Npn\exp_not:o#1{\exp_not:n\exp_after:wN{#1}}
-\cs_new:Npn\exp_not:d#1{
- \exp_not:n\exp_after:wN\exp_after:wN\exp_after:wN{#1}
-}
\cs_new:Npn\exp_not:f#1{
\exp_not:n\exp_after:wN{\tex_romannumeral:D -`0 #1}
}
@@ -204,7 +192,7 @@
\exp_not:n\exp_after:wN{\tex_romannumeral:D -`0 \exp_eval_register:N #1}
}
\cs_new:Npn\exp_not:c#1{\exp_after:wN\exp_not:N\cs:w#1\cs_end:}
-\cs_new:Npn \cs_generate_variant:Nn #1 {
+\cs_new_protected:Npn \cs_generate_variant:Nn #1 {
\chk_if_exist_cs:N #1
\cs_split_function:NN #1 \cs_generate_variant_aux:nnNn
}
@@ -219,7 +207,8 @@
#1:#3\use:c {use_none:\cs_generate_variant_aux:N #3 ?}#2
}
{
- \cs_new_nopar:cpx {
+ \_cs_generate_variant_aux:ccpx { #1 : #2 }
+ {
#1:#3 \use:c{use_none:\cs_generate_variant_aux:N #3 ?}#2
}
{
@@ -240,7 +229,37 @@
\cs_set:Npn \cs_generate_variant_aux:N #1{
\if:w ?#1 \exp_after:wN\use_none:nn \fi: n \cs_generate_variant_aux:N
}
-\cs_new:Npn \cs_generate_internal_variant:n #1 {
+\group_begin:
+ \tex_lccode:D `\Z = `\d \scan_stop:
+ \tex_lccode:D `\? =`\\ \scan_stop:
+ \tex_catcode:D `\P = 12 \scan_stop:
+ \tex_catcode:D `\R = 12 \scan_stop:
+ \tex_catcode:D `\O = 12 \scan_stop:
+ \tex_catcode:D `\T = 12 \scan_stop:
+ \tex_catcode:D `\E = 12 \scan_stop:
+ \tex_catcode:D `\C = 12 \scan_stop:
+ \tex_catcode:D `\Z = 12 \scan_stop:
+\tex_lowercase:D {
+ \group_end:
+ \cs_new_nopar:Npn \_cs_generate_variant_aux:Ncpx #1
+ {
+ \exp_after:wN \_cs_generate_variant_aux:w
+ \tex_meaning:D #1 ? PROTECTEZ \q_nil
+ }
+ \cs_new_nopar:Npn \_cs_generate_variant_aux:ccpx
+ { \exp_args:Nc \_cs_generate_variant_aux:Ncpx}
+ \cs_new:Npn \_cs_generate_variant_aux:w
+ #1 ? PROTECTEZ #2 \q_nil
+ {
+ \exp_after:wN \tex_ifx:D \exp_after:wN
+ \q_nil \etex_detokenize:D {#1} \q_nil
+ \exp_after:wN \cs_new_protected_nopar:cpx
+ \tex_else:D
+ \exp_after:wN \cs_new_nopar:cpx
+ \tex_fi:D
+ }
+}
+\cs_new_protected:Npn \cs_generate_internal_variant:n #1 {
\cs_if_free:cT { exp_args:N #1 }{
\cs_new:cpx { exp_args:N #1 }
{ \cs_generate_internal_variant_aux:n #1 : }