diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3tl.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3tl.sty | 86 |
1 files changed, 53 insertions, 33 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty index 413c68fd926..4dc5ec2b65a 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty @@ -13,7 +13,7 @@ %% %% Do not distribute a modified version of this file. %% -%% File: l3tl.dtx Copyright (C) 1990-2011 The LaTeX3 Project +%% File: l3tl.dtx Copyright (C) 1990-2012 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3tl.dtx 3091 2011-12-25 16:22:59Z bruno $ +\GetIdInfo$Id: l3tl.dtx 3158 2012-01-09 00:47:42Z bruno $ {L3 Experimental token lists} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -202,7 +202,6 @@ \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 -\tl_new:N \l_tl_replace_tl \cs_new_protected_nopar:Npn \tl_replace_once:Nnn { \tl_replace_aux:NNNnn \tl_replace_once_aux: \tl_set:Nx } \cs_new_protected_nopar:Npn \tl_greplace_once:Nnn @@ -325,9 +324,9 @@ \prg_new_protected_conditional:Npnn \tl_if_eq:nn #1#2 { T , F , TF } { \group_begin: - \tl_set:Nn \l_tl_tmpa_tl {#1} - \tl_set:Nn \l_tl_tmpb_tl {#2} - \if_meaning:w \l_tl_tmpa_tl \l_tl_tmpb_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: @@ -335,8 +334,8 @@ \prg_return_false: \fi: } -\tl_new:N \l_tl_tmpa_tl -\tl_new:N \l_tl_tmpb_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 } @@ -433,7 +432,8 @@ \q_mark \tl_reverse_items_aux:wn \q_stop { {#1} #5 } } -\cs_new:Npn \tl_reverse_items_aux:wn #1 \q_stop #2 { \use_none:nn #2 } +\cs_new:Npn \tl_reverse_items_aux:wn #1 \q_stop #2 + { \exp_not:o { \use_none:nn #2 } } \cs_set:Npn \tl_tmp:w #1 { \cs_new:Npn \tl_trim_spaces:n ##1 @@ -482,10 +482,10 @@ \cs_new:Npn \tl_head:w #1#2 \q_stop {#1} \cs_new:Npn \tl_tail:w #1#2 \q_stop {#2} \cs_new:Npn \tl_head:n #1 - { \tl_head:w #1 { } \q_stop } + { \etex_unexpanded:D \exp_after:wN { \tl_head:w #1 { } \q_stop } } \cs_new:Npn \tl_tail:n #1 - { \tl_tail_aux:w #1 \q_mark { } \q_mark \q_stop } -\cs_new:Npn \tl_tail_aux:w #1 #2 \q_mark #3 \q_stop { #2 } + { \etex_unexpanded:D \tl_tail_aux:w #1 \q_mark { } \q_mark \q_stop } +\cs_new:Npn \tl_tail_aux:w #1 #2 \q_mark #3 \q_stop { {#2} } \cs_generate_variant:Nn \tl_head:n { V , v , f } \cs_generate_variant:Nn \tl_tail:n { V , v , f } \cs_new:Npn \str_head:n #1 @@ -683,14 +683,18 @@ \exp_args:Nf #1 { \exp_after:wN \exp_after:wN \exp_after:wN { #2 {#3} } } } -\cs_new:Npn \tl_reverse_tokens:n +\cs_new:Npn \tl_reverse_tokens:n #1 { - \tex_romannumeral:D - \tl_act_aux:NNNnn - \tl_act_reverse_normal:nN - \tl_act_reverse_group:nn - \tl_act_reverse_space:n - { } + \etex_unexpanded:D \exp_after:wN + { + \tex_romannumeral:D + \tl_act_aux:NNNnn + \tl_act_reverse_normal:nN + \tl_act_reverse_group:nn + \tl_act_reverse_space:n + { } + {#1} + } } \cs_new:Npn \tl_act_reverse_space:n #1 { \tl_act_reverse_output:n {~} } @@ -702,22 +706,26 @@ \tl_act_reverse_output:n { \tl_reverse_tokens:n } } -\cs_new:Npn \tl_reverse:n +\cs_new:Npn \tl_reverse:n #1 { - \tex_romannumeral:D - \tl_act_aux:NNNnn - \tl_act_reverse_normal:nN - \tl_act_reverse_group_preserve:nn - \tl_act_reverse_space:n - { } + \etex_unexpanded:D \exp_after:wN + { + \tex_romannumeral:D + \tl_act_aux:NNNnn + \tl_act_reverse_normal:nN + \tl_act_reverse_group_preserve:nn + \tl_act_reverse_space:n + { } + {#1} + } } \cs_new:Npn \tl_act_reverse_group_preserve:nn #1 #2 { \tl_act_reverse_output:n { {#2} } } \cs_generate_variant:Nn \tl_reverse:n { o , V } \cs_new_protected:Npn \tl_reverse:N #1 - { \tl_set:Nf #1 { \tl_reverse:o { #1 \exp_stop_f: } } } + { \tl_set:Nx #1 { \exp_args:No \tl_reverse:n { #1 } } } \cs_new_protected:Npn \tl_greverse:N #1 - { \tl_gset:Nf #1 { \tl_reverse:o { #1 \exp_stop_f: } } } + { \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_length_tokens:n #1 @@ -746,10 +754,22 @@ Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz } -\cs_new:Npn \tl_expandable_uppercase:n - { \tex_romannumeral:D \tl_act_case_aux:nn { \c_tl_act_uppercase_tl } } -\cs_new:Npn \tl_expandable_lowercase:n - { \tex_romannumeral:D \tl_act_case_aux:nn { \c_tl_act_lowercase_tl } } +\cs_new:Npn \tl_expandable_uppercase:n #1 + { + \etex_unexpanded:D \exp_after:wN + { + \tex_romannumeral:D + \tl_act_case_aux:nn { \c_tl_act_uppercase_tl } {#1} + } + } +\cs_new:Npn \tl_expandable_lowercase:n #1 + { + \etex_unexpanded:D \exp_after:wN + { + \tex_romannumeral:D + \tl_act_case_aux:nn { \c_tl_act_lowercase_tl } {#1} + } + } \cs_new:Npn \tl_act_case_aux:nn { \tl_act_aux:NNNnn @@ -790,7 +810,7 @@ { \quark_if_recursion_tail_break:n {#2} \int_compare:nNnTF {#1} = \c_zero - { \tl_map_break:n {#2} } + { \tl_map_break:n { \exp_not:n {#2} } } { \exp_args:Nf \tl_item_aux:nn { \int_eval:n { #1 - 1 } } } } \cs_new_nopar:Npn \tl_item:Nn { \exp_args:No \tl_item:nn } |