summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-12-29 23:03:42 +0000
committerKarl Berry <karl@freefriends.org>2011-12-29 23:03:42 +0000
commit7a50f35d6fd3bd705c78298b1ccc085991638f87 (patch)
tree7f749391d34aa12a37a30a33c00b3098b2320e7c /Master/texmf-dist/tex/latex/l3kernel/l3seq.sty
parent0bc9393ae50667d7ff769a76321a9548a70351fc (diff)
l3kernel 3109 (29dec11)
git-svn-id: svn://tug.org/texlive/trunk@24971 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3seq.sty')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3seq.sty58
1 files changed, 39 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty b/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty
index adfb1684b43..743e17ed121 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty
@@ -46,7 +46,7 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
-\GetIdInfo$Id: l3seq.dtx 3033 2011-12-07 10:12:21Z joseph $
+\GetIdInfo$Id: l3seq.dtx 3085 2011-12-22 16:29:26Z bruno $
{L3 Experimental sequences and stacks}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
@@ -80,7 +80,7 @@
{ \seq_set_split_aux:NNnn \tl_set:Nx }
\cs_new_protected_nopar:Npn \seq_gset_split:Nnn
{ \seq_set_split_aux:NNnn \tl_gset:Nx }
-\cs_new_protected_nopar:Npn \seq_set_split_aux:NNnn #1 #2 #3 #4
+\cs_new_protected:Npn \seq_set_split_aux:NNnn #1 #2 #3 #4
{
\tl_if_empty:nTF {#3}
{ #1 #2 { \tl_map_function:nN {#4} \seq_wrap_item:n } }
@@ -108,9 +108,9 @@
}
\cs_new:Npn \seq_set_split_aux_ii:w #1 \seq_set_split_aux_end:
{ \seq_wrap_item:n {#1} }
-\cs_new_protected_nopar:Npn \seq_concat:NNN #1#2#3
+\cs_new_protected:Npn \seq_concat:NNN #1#2#3
{ \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } }
-\cs_new_protected_nopar:Npn \seq_gconcat:NNN #1#2#3
+\cs_new_protected:Npn \seq_gconcat:NNN #1#2#3
{ \tl_gset:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } }
\cs_generate_variant:Nn \seq_concat:NNN { ccc }
\cs_generate_variant:Nn \seq_gconcat:NNN { ccc }
@@ -201,7 +201,7 @@
\cs_generate_variant:Nn \seq_if_in:NnF { c , cV , cv , co , cx }
\cs_generate_variant:Nn \seq_if_in:NnTF { NV , Nv , No , Nx }
\cs_generate_variant:Nn \seq_if_in:NnTF { c , cV , cv , co , cx }
-\cs_new_protected_nopar:Npn \seq_get_left:NN #1#2
+\cs_new_protected:Npn \seq_get_left:NN #1#2
{
\seq_if_empty_err_break:N #1
\exp_after:wN \seq_get_left_aux:NnwN #1 \q_stop #2
@@ -214,7 +214,7 @@
{ \seq_pop_left_aux:NNN \tl_set:Nn }
\cs_new_protected_nopar:Npn \seq_gpop_left:NN
{ \seq_pop_left_aux:NNN \tl_gset:Nn }
-\cs_new_protected_nopar:Npn \seq_pop_left_aux:NNN #1#2#3
+\cs_new_protected:Npn \seq_pop_left_aux:NNN #1#2#3
{
\seq_if_empty_err_break:N #2
\exp_after:wN \seq_pop_left_aux:NnwNNN #2 \q_stop #1#2#3
@@ -227,13 +227,13 @@
}
\cs_generate_variant:Nn \seq_pop_left:NN { c }
\cs_generate_variant:Nn \seq_gpop_left:NN { c }
-\cs_new_protected_nopar:Npn \seq_get_right:NN #1#2
+\cs_new_protected:Npn \seq_get_right:NN #1#2
{
\seq_if_empty_err_break:N #1
\seq_get_right_aux:NN #1#2
\prg_break_point:n { }
}
-\cs_new_protected_nopar:Npn \seq_get_right_aux:NN #1#2
+\cs_new_protected:Npn \seq_get_right_aux:NN #1#2
{
\seq_push_item_def:n { }
\exp_after:wN \exp_after:wN \exp_after:wN \seq_get_right_loop:nn
@@ -255,13 +255,13 @@
{ \seq_pop_right_aux:NNN \tl_set:Nx }
\cs_new_protected_nopar:Npn \seq_gpop_right:NN
{ \seq_pop_right_aux:NNN \tl_gset:Nx }
-\cs_new_protected_nopar:Npn \seq_pop_right_aux:NNN #1#2#3
+\cs_new_protected:Npn \seq_pop_right_aux:NNN #1#2#3
{
\seq_if_empty_err_break:N #2
\seq_pop_right_aux_ii:NNN #1 #2 #3
\prg_break_point:n { }
}
-\cs_new_protected_nopar:Npn \seq_pop_right_aux_ii:NNN #1#2#3
+\cs_new_protected:Npn \seq_pop_right_aux_ii:NNN #1#2#3
{
\seq_push_item_def:n { \seq_wrap_item:n {##1} }
#1 #2 { \if_false: } \fi:
@@ -283,7 +283,7 @@
\cs_new_eq:NN \seq_break:n \prg_map_break:n
\cs_new_eq:NN \seq_map_break: \prg_map_break:
\cs_new_eq:NN \seq_map_break:n \prg_map_break:n
-\cs_new_protected_nopar:Npn \seq_if_empty_err_break:N #1
+\cs_new_protected:Npn \seq_if_empty_err_break:N #1
{
\if_meaning:w #1 \c_empty_tl
\msg_kernel_error:nnx { seq } { empty-sequence } { \token_to_str:N #1 }
@@ -370,7 +370,7 @@
\cs_new_eq:NN \seq_pop:cN \seq_pop_left:cN
\cs_new_eq:NN \seq_gpop:NN \seq_gpop_left:NN
\cs_new_eq:NN \seq_gpop:cN \seq_gpop_left:cN
-\cs_new_protected_nopar:Npn \seq_show:N #1
+\cs_new_protected:Npn \seq_show:N #1
{
\msg_aux_show:Nnx
#1
@@ -378,7 +378,7 @@
{ \seq_map_function:NN #1 \msg_aux_show:n }
}
\cs_generate_variant:Nn \seq_show:N { c }
-\cs_new_nopar:Npn \seq_if_empty_break_return_false:N #1
+\cs_new:Npn \seq_if_empty_break_return_false:N #1
{
\if_meaning:w #1 \c_empty_tl
\prg_return_false:
@@ -456,7 +456,7 @@
}
\cs_new:Npn \seq_length_aux:n #1 { +1 }
\cs_generate_variant:Nn \seq_length:N { c }
-\cs_new_nopar:Npn \seq_item:Nn #1#2
+\cs_new:Npn \seq_item:Nn #1#2
{
\exp_last_unbraced:Nfo \seq_item_aux:nnn
{
@@ -472,7 +472,7 @@
{ }
\prg_break_point:n { }
}
-\cs_new_nopar:Npn \seq_item_aux:nnn #1#2#3
+\cs_new:Npn \seq_item_aux:nnn #1#2#3
{
\use_none:n #2
\int_compare:nNnTF {#1} = \c_zero
@@ -480,9 +480,9 @@
{ \exp_args:Nf \seq_item_aux:nnn { \int_eval:n { #1 - 1 } } }
}
\cs_generate_variant:Nn \seq_item:Nn { c }
-\cs_new_nopar:Npn \seq_use:N #1 { \seq_map_function:NN #1 \use:n }
+\cs_new:Npn \seq_use:N #1 { \seq_map_function:NN #1 \use:n }
\cs_generate_variant:Nn \seq_use:N { c }
-\cs_new_nopar:Npn \seq_mapthread_function:NNN #1#2#3
+\cs_new:Npn \seq_mapthread_function:NNN #1#2#3
{
\exp_after:wN \seq_mapthread_function_aux:NN
\exp_after:wN #3
@@ -491,7 +491,7 @@
{ ? \seq_break: } { }
\prg_break_point:n { }
}
-\cs_new_nopar:Npn \seq_mapthread_function_aux:NN #1#2
+\cs_new:Npn \seq_mapthread_function_aux:NN #1#2
{
\exp_after:wN \seq_mapthread_function_aux:Nnnwnn
\exp_after:wN #1
@@ -539,7 +539,7 @@
{ \seq_reverse_aux:NN \tl_set:Nx }
\cs_new_protected_nopar:Npn \seq_greverse:N
{ \seq_reverse_aux:NN \tl_gset:Nx }
-\cs_new_protected_nopar:Npn \seq_reverse_aux:NN #1 #2
+\cs_new_protected:Npn \seq_reverse_aux:NN #1 #2
{
\cs_set_eq:NN \seq_tmp:w \seq_item:n
\cs_set_eq:NN \seq_item:n \seq_reverse_aux_item:nwn
@@ -553,6 +553,26 @@
}
\cs_generate_variant:Nn \seq_reverse:N { c }
\cs_generate_variant:Nn \seq_greverse:N { c }
+\cs_new_protected_nopar:Npn \seq_set_filter:NNn
+ { \seq_set_filter_aux:NNNn \tl_set:Nx }
+\cs_new_protected_nopar:Npn \seq_gset_filter:NNn
+ { \seq_set_filter_aux:NNNn \tl_gset:Nx }
+\cs_new_protected:Npn \seq_set_filter_aux:NNNn #1#2#3#4
+ {
+ \seq_push_item_def:n { \bool_if:nT {#4} { \seq_wrap_item:n {##1} } }
+ #1 #2 { #3 \prg_break_point:n { } }
+ \seq_pop_item_def:
+ }
+\cs_new_protected_nopar:Npn \seq_set_map:NNn
+ { \seq_set_map_aux:NNNn \tl_set:Nx }
+\cs_new_protected_nopar:Npn \seq_gset_map:NNn
+ { \seq_set_map_aux:NNNn \tl_gset:Nx }
+\cs_new_protected:Npn \seq_set_map_aux:NNNn #1#2#3#4
+ {
+ \seq_push_item_def:n { \exp_not:N \seq_item:n {#4} }
+ #1 #2 { #3 }
+ \seq_pop_item_def:
+ }
%%
%%
%% End of file `l3seq.sty'.