summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/expl3/l3tl.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/expl3/l3tl.sty')
-rw-r--r--Master/texmf-dist/tex/latex/expl3/l3tl.sty201
1 files changed, 30 insertions, 171 deletions
diff --git a/Master/texmf-dist/tex/latex/expl3/l3tl.sty b/Master/texmf-dist/tex/latex/expl3/l3tl.sty
index c55f9dc82ab..19df9805a95 100644
--- a/Master/texmf-dist/tex/latex/expl3/l3tl.sty
+++ b/Master/texmf-dist/tex/latex/expl3/l3tl.sty
@@ -48,7 +48,7 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
-\GetIdInfo$Id: l3tl.dtx 1919 2010-05-22 05:56:38Z will $
+\GetIdInfo$Id: l3tl.dtx 2040 2010-09-21 18:11:09Z joseph $
{L3 Experimental Token Lists}
\ProvidesExplPackage
{\filename}{\filedate}{\fileversion}{\filedescription}
@@ -229,6 +229,20 @@
\cs_generate_variant:Nn \tl_if_eq:NNTF {Nc,c,cc}
\cs_generate_variant:Nn \tl_if_eq:NNT {Nc,c,cc}
\cs_generate_variant:Nn \tl_if_eq:NNF {Nc,c,cc}
+\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}
+ \tex_ifx:D \l_tl_tmpa_tl \l_tl_tmpb_tl
+ \group_end:
+ \prg_return_false:
+ \tex_else:D
+ \group_end:
+ \prg_return_false:
+ \tex_fi:D
+}
+\tl_new:N \l_tl_tmpa_tl
+\tl_new:N \l_tl_tmpb_tl
\prg_new_conditional:Npnn \tl_if_empty:n #1 {p,TF,T,F} {
\exp_after:wN \if_meaning:w \exp_after:wN \q_nil \tl_to_str:n {#1} \q_nil
\prg_return_true: \else: \prg_return_false: \fi:
@@ -242,9 +256,9 @@
\cs_generate_variant:Nn \tl_if_empty:nT {o}
\cs_generate_variant:Nn \tl_if_empty:nF {o}
\prg_new_conditional:Npnn \tl_if_blank:n #1 {p,TF,T,F} {
- \exp_after:wN \tl_if_blank_p_aux:w \tl_to_str:n {#1} aa..\q_nil
+ \exp_after:wN \tl_if_blank_p_aux:w \tl_to_str:n {#1} aa..\q_stop
}
-\cs_new:Npn \tl_if_blank_p_aux:w #1#2 a #3#4 \q_nil {
+\cs_new:Npn \tl_if_blank_p_aux:w #1#2 a #3#4 \q_stop {
\if_meaning:w #3 #4 \prg_return_true: \else: \prg_return_false: \fi:
}
\cs_generate_variant:Nn \tl_if_blank_p:n {V}
@@ -262,7 +276,7 @@
\tl_if_blank:nTF {#1}
{\prg_return_true:}
{
- \_tl_if_single_aux:w #1 \q_nil
+ \_tl_if_single_aux:w #1 \q_stop
}
}
}
@@ -273,168 +287,13 @@
\exp_after:wN \tl_if_blank:nTF #1
{\prg_return_true:}
{
- \exp_after:wN \_tl_if_single_aux:w #1 \q_nil
+ \exp_after:wN \_tl_if_single_aux:w #1 \q_stop
}
}
}
-\cs_new:Npn \_tl_if_single_aux:w #1#2 \q_nil {
+\cs_new:Npn \_tl_if_single_aux:w #1#2 \q_stop {
\tl_if_empty:nTF {#2} \prg_return_true: \prg_return_false:
}
-\cs_new_eq:NN \tl_compare:xx \pdf_strcmp:D
-\cs_new:Npn \tl_compare:nn #1#2{
- \tl_compare:xx{\exp_not:n{#1}}{\exp_not:n{#2}}
-}
-\cs_new:Npn \tl_compare:nx #1{
- \tl_compare:xx{\exp_not:n{#1}}
-}
-\cs_new:Npn \tl_compare:xn #1#2{
- \tl_compare:xx{#1}{\exp_not:n{#2}}
-}
-\cs_new:Npn \tl_compare:nV #1#2 {
- \tl_compare:xx { \exp_not:n {#1} } { \exp_not:V #2 }
-}
-\cs_new:Npn \tl_compare:no #1#2{
- \tl_compare:xx{\exp_not:n{#1}}{\exp_not:n\exp_after:wN{#2}}
-}
-\cs_new:Npn \tl_compare:Vn #1#2 {
- \tl_compare:xx { \exp_not:V #1 } { \exp_not:n {#2} }
-}
-\cs_new:Npn \tl_compare:on #1#2{
- \tl_compare:xx{\exp_not:n\exp_after:wN{#1}}{\exp_not:n{#2}}
-}
-\cs_new:Npn \tl_compare:VV #1#2 {
- \tl_compare:xx { \exp_not:V #1 } { \exp_not:V #2 }
-}
-\cs_new:Npn \tl_compare:oo #1#2{
- \tl_compare:xx{\exp_not:n\exp_after:wN{#1}}{\exp_not:n\exp_after:wN{#2}}
-}
-\cs_new:Npn \tl_compare:xV #1#2 {
- \tl_compare:xx {#1} { \exp_not:V #2 }
-}
-\cs_new:Npn \tl_compare:xo #1#2{
- \tl_compare:xx{#1}{\exp_not:n\exp_after:wN{#2}}
-}
-\cs_new:Npn \tl_compare:Vx #1#2 {
- \tl_compare:xx { \exp_not:V #1 } {#2}
-}
-\cs_new:Npn \tl_compare:ox #1#2{
- \tl_compare:xx{\exp_not:n\exp_after:wN{#1}}{#2}
-}
-\cs_set_nopar:Npn \tl_tmp:w #1 {
- \tl_set:Nx \l_kernel_tmpa_tl {
- \exp_not:N \prg_new_conditional:Npnn \exp_not:c {tl_if_eq:#1}
- ####1 ####2 {p,TF,T,F} {
- \exp_not:N \tex_ifnum:D
- \exp_not:c {tl_compare:#1} {####1}{####2}
- \exp_not:n{ =\c_zero \prg_return_true: \else: \prg_return_false: \fi: }
- }
- }
- \l_kernel_tmpa_tl
-}
-\tl_tmp:w{xx} \tl_tmp:w{nx} \tl_tmp:w{ox} \tl_tmp:w{Vx}
-\tl_tmp:w{xn} \tl_tmp:w{nn} \tl_tmp:w{on} \tl_tmp:w{Vn}
-\tl_tmp:w{xo} \tl_tmp:w{no} \tl_tmp:w{oo}
-\tl_tmp:w{xV} \tl_tmp:w{nV} \tl_tmp:w{VV}
-\cs_if_exist:cF{pdf_strcmp:D}{
- \prg_set_protected_conditional:Npnn \tl_if_eq:nn #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl {\exp_not:n{#1}}
- \tl_set:Nx \l_kernel_testb_tl {\exp_not:n{#2}}
- \if_meaning:w\l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:nV #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl { \exp_not:n {#1} }
- \tl_set:Nx \l_kernel_testb_tl { \exp_not:V #2 }
- \if_meaning:w \l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:no #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl {\exp_not:n{#1}}
- \tl_set:Nx \l_kernel_testb_tl {\exp_not:o{#2}}
- \if_meaning:w\l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:nx #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl {\exp_not:n{#1}}
- \tl_set:Nx \l_kernel_testb_tl {#2}
- \if_meaning:w\l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:Vn #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl { \exp_not:V #1 }
- \tl_set:Nx \l_kernel_testb_tl { \exp_not:n{#2} }
- \if_meaning:w \l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:on #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl {\exp_not:o{#1}}
- \tl_set:Nx \l_kernel_testb_tl {\exp_not:n{#2}}
- \if_meaning:w\l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:VV #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl { \exp_not:V #1 }
- \tl_set:Nx \l_kernel_testb_tl { \exp_not:V #2 }
- \if_meaning:w \l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:oo #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl {\exp_not:o{#1}}
- \tl_set:Nx \l_kernel_testb_tl {\exp_not:o{#2}}
- \if_meaning:w\l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:Vx #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl { \exp_not:V #1 }
- \tl_set:Nx \l_kernel_testb_tl {#2}
- \if_meaning:w \l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:ox #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl {\exp_not:o{#1}}
- \tl_set:Nx \l_kernel_testb_tl {#2}
- \if_meaning:w\l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:xn #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl {#1}
- \tl_set:Nx \l_kernel_testb_tl {\exp_not:n{#2}}
- \if_meaning:w\l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:xV #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl {#1}
- \tl_set:Nx \l_kernel_testb_tl { \exp_not:V #2 }
- \if_meaning:w \l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:xo #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl {#1}
- \tl_set:Nx \l_kernel_testb_tl {\exp_not:o{#2}}
- \if_meaning:w\l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
- \prg_set_protected_conditional:Npnn \tl_if_eq:xx #1#2 {TF,T,F} {
- \tl_set:Nx \l_kernel_testa_tl {#1}
- \tl_set:Nx \l_kernel_testb_tl {#2}
- \if_meaning:w\l_kernel_testa_tl \l_kernel_testb_tl
- \prg_return_true: \else: \prg_return_false:
- \fi:
- }
-}
\cs_new_eq:NN \tl_to_lowercase:n \tex_lowercase:D
\cs_new_eq:NN \tl_to_uppercase:n \tex_uppercase:D
\cs_new_eq:NN \tl_to_str:n \etex_detokenize:D
@@ -650,29 +509,29 @@
}
\cs_generate_variant:Nn \tl_remove_all_in:Nn {cn}
\cs_generate_variant:Nn \tl_gremove_all_in:Nn {cn}
-\cs_new:Npn \tl_head:n #1{\tl_head:w #1\q_nil}
+\cs_new:Npn \tl_head:n #1{\tl_head:w #1\q_stop}
\cs_new_eq:NN \tl_head_i:n \tl_head:n
-\cs_new:Npn \tl_tail:n #1{\tl_tail:w #1\q_nil}
+\cs_new:Npn \tl_tail:n #1{\tl_tail:w #1\q_stop}
\cs_generate_variant:Nn \tl_tail:n {f}
-\cs_new:Npn \tl_head_iii:n #1{\tl_head_iii:w #1\q_nil}
+\cs_new:Npn \tl_head_iii:n #1{\tl_head_iii:w #1\q_stop}
\cs_generate_variant:Nn \tl_head_iii:n {f}
-\cs_new_eq:NN \tl_head:w \use_i_delimit_by_q_nil:nw
+\cs_new:Npn \tl_head:w #1#2\q_stop{#1}
\cs_new_eq:NN \tl_head_i:w \tl_head:w
-\cs_new:Npn \tl_tail:w #1#2\q_nil{#2}
-\cs_new:Npn \tl_head_iii:w #1#2#3#4\q_nil{#1#2#3}
+\cs_new:Npn \tl_tail:w #1#2\q_stop{#2}
+\cs_new:Npn \tl_head_iii:w #1#2#3#4\q_stop{#1#2#3}
\cs_generate_variant:Nn \tl_head:n { V }
\cs_generate_variant:Nn \tl_tail:n { V }
\prg_new_conditional:Npnn \tl_if_head_eq_meaning:nN #1#2 {p,TF,T,F} {
- \exp_after:wN \if_meaning:w \tl_head:w #1 \q_nil #2
+ \exp_after:wN \if_meaning:w \tl_head:w #1 \q_stop #2
\prg_return_true: \else: \prg_return_false: \fi:
}
\prg_new_conditional:Npnn \tl_if_head_eq_charcode:nN #1#2 {p,TF,T,F} {
\exp_after:wN \if:w \exp_after:wN \exp_not:N
- \tl_head:w #1 \q_nil \exp_not:N #2
+ \tl_head:w #1 \q_stop \exp_not:N #2
\prg_return_true: \else: \prg_return_false: \fi:
}
%% \cs_new:Npn \tl_if_head_eq_charcode_p:fN #1#2{
-%% \exp_after:wN\if_charcode:w \tl_head:w #1\q_nil\exp_not:N#2
+%% \exp_after:wN\if_charcode:w \tl_head:w #1\q_stop\exp_not:N#2
%% \c_true_bool
%% \else:
%% \c_false_bool
@@ -686,7 +545,7 @@
\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF {f}
\prg_new_conditional:Npnn \tl_if_head_eq_catcode:nN #1#2 {p,TF,T,F} {
\exp_after:wN \if_catcode:w \exp_after:wN \exp_not:N
- \tl_head:w #1 \q_nil \exp_not:N #2
+ \tl_head:w #1 \q_stop \exp_not:N #2
\prg_return_true: \else: \prg_return_false: \fi:
}
\tex_ifodd:D \@l@expl@check@declarations@bool \scan_stop: