summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3tl.sty')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3tl.sty51
1 files changed, 39 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty
index 8a8d89bb904..ef644d3dfd6 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty
@@ -46,7 +46,7 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3tl.dtx 4201 2012-09-05 08:00:54Z joseph $
+\GetIdInfo$Id: l3tl.dtx 4244 2012-09-28 22:46:36Z bruno $
{L3 Token lists}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
@@ -216,8 +216,10 @@
\cs_generate_variant:Nn \tl_set_rescan:Nnn { c , cno , cnx }
\cs_generate_variant:Nn \tl_gset_rescan:Nnn { Nno , Nnx }
\cs_generate_variant:Nn \tl_gset_rescan:Nnn { c , cno }
-\cs_new_eq:NN \tl_to_lowercase:n \tex_lowercase:D
-\cs_new_eq:NN \tl_to_uppercase:n \tex_uppercase:D
+\cs_new_protected:Npn \tl_to_lowercase:n #1
+ { \tex_lowercase:D {#1} }
+\cs_new_protected:Npn \tl_to_uppercase:n #1
+ { \tex_uppercase:D {#1} }
\cs_new_protected_nopar:Npn \tl_replace_once:Nnn
{ \__tl_replace:NNNnn \__tl_replace_once: \tl_set:Nx }
\cs_new_protected_nopar:Npn \tl_greplace_once:Nnn
@@ -340,9 +342,9 @@
\prg_new_protected_conditional:Npnn \tl_if_eq:nn #1#2 { T , F , TF }
{
\group_begin:
- \tl_set:Nn \l_tl_internal_a_tl {#1}
- \tl_set:Nn \l_tl_internal_b_tl {#2}
- \if_meaning:w \l_tl_internal_a_tl \l_tl_internal_b_tl
+ \tl_set:Nn \l__tl_internal_a_tl {#1}
+ \tl_set:Nn \l__tl_internal_b_tl {#2}
+ \if_meaning:w \l__tl_internal_a_tl \l__tl_internal_b_tl
\group_end:
\prg_return_true:
\else:
@@ -350,8 +352,8 @@
\prg_return_false:
\fi:
}
-\tl_new:N \l_tl_internal_a_tl
-\tl_new:N \l_tl_internal_b_tl
+\tl_new:N \l__tl_internal_a_tl
+\tl_new:N \l__tl_internal_b_tl
\cs_new_protected_nopar:Npn \tl_if_in:NnT { \exp_args:No \tl_if_in:nnT }
\cs_new_protected_nopar:Npn \tl_if_in:NnF { \exp_args:No \tl_if_in:nnF }
\cs_new_protected_nopar:Npn \tl_if_in:NnTF { \exp_args:No \tl_if_in:nnTF }
@@ -588,10 +590,26 @@
{ \tl_gset:Nx #1 { \exp_args:No \tl_reverse:n { #1 } } }
\cs_generate_variant:Nn \tl_reverse:N { c }
\cs_generate_variant:Nn \tl_greverse:N { c }
-\cs_new:Npn \tl_head:w #1#2 \q_stop {#1}
\cs_new:Npn \tl_head:n #1
- { \etex_unexpanded:D \exp_after:wN { \tl_head:w #1 { } \q_stop } }
+ {
+ \etex_unexpanded:D
+ \if_false: { \fi: \__tl_head_i:nw #1 { } \q_stop }
+ }
+\cs_new:Npn \__tl_head_i:nw #1#2 \q_stop
+ { \exp_after:wN \__tl_head_ii:nw \exp_after:wN { \if_false: } \fi: {#1} }
+\cs_new:Npn \__tl_head_ii:nw #1
+ {
+ \exp_after:wN \if_meaning:w \exp_after:wN \q_nil
+ \tl_to_str:n \exp_after:wN { \use_none:n #1 } \q_nil
+ \exp_after:wN \use_i:nn
+ \else:
+ \exp_after:wN \use_ii:nn
+ \fi:
+ {#1}
+ { \if_false: { \fi: \__tl_head_i:nw #1 } }
+ }
\cs_generate_variant:Nn \tl_head:n { V , v , f }
+\cs_new:Npn \tl_head:w #1#2 \q_stop {#1}
\cs_new_nopar:Npn \tl_head:N { \exp_args:No \tl_head:n }
\cs_new:Npn \tl_tail:n #1
{
@@ -723,9 +741,18 @@
{ \exp_after:wN \c_zero \exp_after:wN \prg_return_false: }
\exp_after:wN \use_none:n \exp_after:wN { \if_false: } \fi:
}
-\cs_new_protected:Npn \tl_show:N #1 { \cs_show:N #1 }
+\cs_new_protected:Npn \tl_show:N #1
+ {
+ \cs_if_exist:NTF #1
+ { \cs_show:N #1 }
+ {
+ \__msg_kernel_error:nnx { kernel } { variable-not-defined }
+ { \token_to_str:N #1 }
+ }
+ }
\cs_generate_variant:Nn \tl_show:N { c }
-\cs_new_eq:NN \tl_show:n \etex_showtokens:D
+\cs_new_protected:Npn \tl_show:n #1
+ { \__msg_show_variable:n { > ~ \tl_to_str:n {#1} } }
\tl_new:N \g_tmpa_tl
\tl_new:N \g_tmpb_tl
\tl_new:N \l_tmpa_tl