summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/expl3/l3seq.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/expl3/l3seq.sty')
-rw-r--r--Master/texmf-dist/tex/latex/expl3/l3seq.sty116
1 files changed, 84 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/latex/expl3/l3seq.sty b/Master/texmf-dist/tex/latex/expl3/l3seq.sty
index f2856e4366e..096b825697f 100644
--- a/Master/texmf-dist/tex/latex/expl3/l3seq.sty
+++ b/Master/texmf-dist/tex/latex/expl3/l3seq.sty
@@ -15,18 +15,48 @@
%% Do not distribute a modified version of this file.
%%
%%
-%% File: l3seq.dtx Copyright (C) 1990-1998 LaTeX3 project
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{l3seq}
- [1998/04/20 v1.0d L3 Experimental Token List Pointers]
-\RequirePackage{l3toks}
+%% File: l3seq.dtx Copyright (C) 1990-2006 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
+%% license or (at your option) any later version. The latest version
+%% of this license is in the file
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% This file is part of the ``expl3 bundle'' (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+\RequirePackage{l3names}
+\GetIdInfo$Id: l3seq.dtx 573 2006-08-21 20:59:37Z morten $
+ {L3 Experimental sequences and stacks}
\RequirePackage{l3quark}
+\RequirePackage{l3tlp}
\RequirePackage{l3expan}
-\let_new:NN \seq_elt:w \use_noop:
-\let_new:NN \seq_elt_end: \use_noop:
+\let_new:NN \seq_elt:w \ERROR
+\let_new:NN \seq_elt_end: \ERROR
\def_new:Npn \seq_new:N #1{\tlp_new:Nn #1{}}
\def_new:Npn \seq_new:c {\exp_args:Nc \seq_new:N}
-\def_new:Npn \seq_new:O {\exp_args:No \seq_new:N}
\let_new:NN \seq_clear:N \tlp_clear:N
\let_new:NN \seq_clear:c \tlp_clear:c
\let_new:NN \seq_gclear:N \tlp_gclear:N
@@ -35,27 +65,22 @@
\let_new:NN \seq_clear_new:c \tlp_clear_new:c
\let_new:NN \seq_gclear_new:N \tlp_gclear_new:N
\let_new:NN \seq_gclear_new:c \tlp_gclear_new:c
-\let_new:NN \seq_empty_p:N \tlp_empty_p:N
-\def_new:Npn \seq_empty:NTF #1{
- \if_meaning:NN#1\c_empty_tlp
- \exp_after:NN\use_choice_i:nn
- \else: \exp_after:NN\use_choice_ii:nn \fi:}
-\def_new:Npn \seq_empty:cTF {\exp_args:Nc\seq_empty:NTF}
-\def_new:Npn \seq_empty:NF #1{
- \if_meaning:NN#1\c_empty_tlp \exp_after:NN\use_none:n
- \else: \exp_after:NN\use:n \fi:}
-\def_new:Npn \seq_empty:cF {\exp_args:Nc\seq_empty:NF}
-\def_new:Npn \seq_empty_err:N #1{\if_meaning:NN#1\c_empty_tlp
+\let_new:NN \seq_if_empty_p:N \tlp_if_empty_p:N
+\let_new:NN \seq_if_empty:NTF \tlp_if_empty:NTF
+\def_new:Npn \seq_if_empty:cTF {\exp_args:Nc\seq_if_empty:NTF}
+\let_new:NN \seq_if_empty:NF \tlp_if_empty:NF
+\def_new:Npn \seq_if_empty:cF {\exp_args:Nc\seq_if_empty:NF}
+\def_new:Npn \seq_if_empty_err:N #1{\if_meaning:NN#1\c_empty_tlp
\tlp_clear:N \l_testa_tlp % catch prefixes
- \err_latex_bug:n{Empty~sequence~`\token_to_string:N#1'}\fi:}
+ \err_latex_bug:x{Empty~sequence~`\token_to_string:N#1'}\fi:}
\def_new:Npn \seq_get:NN #1{
- \seq_empty_err:N #1
+ \seq_if_empty_err:N #1
\exp_after:NN\seq_get_aux:w #1\q_stop}
\def_new:Npn \seq_get_aux:w \seq_elt:w #1\seq_elt_end:
#2\q_stop #3{\tlp_set:Nn #3{#1}}
\def_new:Npn \seq_get:cN {\exp_args:Nc \seq_get:NN}
\def_new:Npn \seq_pop_aux:nnNN #1#2#3{
- \seq_empty_err:N #3
+ \seq_if_empty_err:N #3
\exp_after:NN\seq_pop_aux:w #3\q_stop #1#2#3}
\def_new:Npn \seq_pop_aux:w \seq_elt:w #1\seq_elt_end:
#2\q_stop #3#4#5#6{#3#5{#2}#4#6{#1}}
@@ -69,33 +94,57 @@
\def_new:Npn \seq_put_left:Nx {\exp_args:Nnx\seq_put_left:Nn}
\def_new:Npn \seq_put_right:Nn #1#2{
\seq_put_aux:Nnn #1{}{\seq_elt:w #2\seq_elt_end:}}
-\def_new:Npn \seq_put_right:No {\exp_args:Nno\seq_put_right:Nn}
-\def_new:Npn \seq_put_right:Nx {\exp_args:Nnx\seq_put_right:Nn}
+\def_new:Npn \seq_put_right:No {\exp_args:NNo\seq_put_right:Nn}
+\def_new:Npn \seq_put_right:Nx {\exp_args:NNx\seq_put_right:Nn}
\def_new:Npn \seq_gput_left:Nn {
+ \pref_global:D
\seq_put_left:Nn}
\def_new:Npn \seq_gput_right:Nn {
+ \pref_global:D
\seq_put_right:Nn}
\def_new:Npn \seq_gput_right:No {\exp_args:NNo \seq_gput_right:Nn}
+\def_new:Npn \seq_gput_right:Nc {\exp_args:NNc \seq_gput_right:Nn}
\def_new:Npn \seq_gput_right:cn {\exp_args:Nc \seq_gput_right:Nn}
\def_new:Npn \seq_gput_right:co {\exp_args:Nco \seq_gput_right:Nn}
\def_new:Npn \seq_gput_right:cc {\exp_args:Ncc \seq_gput_right:Nn}
+\def_new:Npn \seq_map_variable_aux:Nnw #1#2\seq_elt:w#3\seq_elt_end:{
+ \tlp_set:Nn #1{#3}
+ \quark_if_nil:NT #1 \seq_map_break:w
+ #2
+ \seq_map_variable_aux:Nnw #1{#2}
+}
+\def_new:Npn \seq_map_variable:NNn #1#2#3{
+ \tlp_set:Nx #2 {\exp_not:n{\seq_map_variable_aux:Nnw #2{#3}}}
+ \exp_after:NN #2 #1 \seq_elt:w \q_nil\seq_elt_end: \q_stop
+}
+\def_new:Npn \seq_map_variable:cNn{\exp_args:Nc\seq_map_variable:Nn}
+\let_new:NN \seq_map_break:w \use_none_delimit_by_q_stop:w
\def_new:Npn \seq_map:NN #1#2{
- \def:Npn \seq_elt:w ##1\seq_elt_end: {#2{##1}}#1}
+ \def:Npn \seq_elt:w ##1\seq_elt_end: {#2{##1}}#1
+ \let:NN \seq_elt:w \ERROR
+}
\def_new:Npn \seq_map_inline:Nn #1#2{
- \gdef:Npn \seq_elt:w ##1\seq_elt_end: {#2}#1}
+ \def:Npn \seq_elt:w ##1\seq_elt_end: {#2}#1
+ \let:NN \seq_elt:w \ERROR
+}
\def_new:Npn \seq_map_inline:cn{\exp_args:Nc\seq_map_inline:Nn}
+\let_new:NN \seq_set_eq:NN \let:NN
+\def_new:Npn \seq_set_eq:Nc {\exp_args:NNc \seq_set_eq:NN}
+\let_new:NN \seq_gset_eq:NN \glet:NN
+\def_new:Npn \seq_gset_eq:cN {\exp_args:Nc \seq_gset_eq:NN}
+\def_new:Npn \seq_gset_eq:Nc {\exp_args:NNc \seq_gset_eq:NN}
+\def_new:Npn \seq_gset_eq:cc {\exp_args:Ncc \seq_gset_eq:NN}
\def_new:Npn \seq_gconcat:NNN #1#2#3{
- \l_tmpa_toks \exp_after:NN{#2}
- \l_tmpb_toks \exp_after:NN{#3}
- \gdef:Npx #1{\toks_use:N \l_tmpa_toks \toks_use:N \l_tmpb_toks}}
+ \tlp_gset:Nx #1 {\exp_not:o{#2}\exp_not:o{#3}}
+}
\def_new:Npn \seq_gconcat:ccc{\exp_args:Nccc\seq_gconcat:NNN}
\def_new:Npn \seq_if_in:NnTF #1#2{
\def:Npn\tmp:w
##1\seq_elt:w #2\seq_elt_end: ##2##3\q_stop{
\if_meaning:NN\q_no_value##2
- \exp_after:NN\use_choice_ii:nn
+ \exp_after:NN\use_arg_ii:nn
\else:
- \exp_after:NN\use_choice_i:nn
+ \exp_after:NN\use_arg_i:nn
\fi:
}
\exp_after:NN
@@ -103,6 +152,9 @@
#2\seq_elt_end: \q_no_value \q_stop}
\def_new:Npn \seq_if_in:coTF {\exp_args:Nco \seq_if_in:NnTF}
\def_new:Npn \seq_if_in:cnTF {\exp_args:Nc \seq_if_in:NnTF}
+\def_new:Npn \seq_if_in:cxTF {\exp_args:Ncx \seq_if_in:NnTF}
+\def_new:Npn \seq_if_in:NnF #1#2 { \seq_if_in:NnTF #1{#2}\use_noop: }
+\def_new:Npn \seq_if_in:cnF {\exp_args:Nc \seq_if_in:NnF}
\let_new:NN \seq_push:Nn \seq_put_left:Nn
\let_new:NN \seq_push:No \seq_put_left:No
\let_new:NN \seq_push:cn \seq_put_left:cn
@@ -111,11 +163,11 @@
\let_new:NN \seq_gpush:Nn \seq_gput_left:Nn
\def_new:Npn \seq_gpush:No {\exp_args:NNo \seq_gpush:Nn}
\def_new:Npn \seq_gpush:cn {\exp_args:Nc \seq_gpush:Nn}
+\def_new:Npn \seq_gpush:NC {\exp_args:NNC \seq_gpush:Nn}
\def_new:Npn \seq_gpop:NN {\seq_pop_aux:nnNN \tlp_gset:Nn \tlp_set:Nn}
\def_new:Npn \seq_gpop:cN {\exp_args:Nc \seq_gpop:NN}
\let_new:NN \seq_top:NN \seq_get:NN
\let_new:NN \seq_top:cN \seq_get:cN
-
%%
%%
%% End of file `l3seq.sty'.