blob: f2856e4366e075a918e8e2619dce6e6a3945c4fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
%%
%% This is file `l3seq.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% l3seq.dtx (with options: `package,trace')
%%
%%
%% EXPERIMENTAL CODE
%%
%% Do not distribute this file without also distributing the
%% source files specified above.
%%
%% 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}
\RequirePackage{l3quark}
\RequirePackage{l3expan}
\let_new:NN \seq_elt:w \use_noop:
\let_new:NN \seq_elt_end: \use_noop:
\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
\let_new:NN \seq_gclear:c \tlp_gclear:c
\let_new:NN \seq_clear_new:N \tlp_clear_new:N
\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
\tlp_clear:N \l_testa_tlp % catch prefixes
\err_latex_bug:n{Empty~sequence~`\token_to_string:N#1'}\fi:}
\def_new:Npn \seq_get:NN #1{
\seq_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
\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}}
\def_new:Npn \seq_put_aux:Nnn #1{
\exp_after:NN\seq_put_aux:w #1\q_stop #1}
\def_new:Npn \seq_put_aux:w #1\q_stop #2#3#4{\tlp_set:Nn #2{#3#1#4}}
\def_new:Npn \seq_put_left:Nn #1#2{
\seq_put_aux:Nnn #1{\seq_elt:w #2\seq_elt_end:}{}}
\def_new:Npn \seq_put_left:cn {\exp_args:Nc\seq_put_left:Nn}
\def_new:Npn \seq_put_left:No {\exp_args:NNo\seq_put_left:Nn}
\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_gput_left:Nn {
\seq_put_left:Nn}
\def_new:Npn \seq_gput_right:Nn {
\seq_put_right:Nn}
\def_new:Npn \seq_gput_right:No {\exp_args:NNo \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:NN #1#2{
\def:Npn \seq_elt:w ##1\seq_elt_end: {#2{##1}}#1}
\def_new:Npn \seq_map_inline:Nn #1#2{
\gdef:Npn \seq_elt:w ##1\seq_elt_end: {#2}#1}
\def_new:Npn \seq_map_inline:cn{\exp_args:Nc\seq_map_inline: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}}
\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
\else:
\exp_after:NN\use_choice_i:nn
\fi:
}
\exp_after:NN
\tmp:w #1\seq_elt:w
#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}
\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
\def_new:Npn \seq_pop:NN {\seq_pop_aux:nnNN \tlp_set:Nn \tlp_set:Nn}
\def_new:Npn \seq_pop:cN {\exp_args:Nc \seq_pop:NN}
\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_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'.
|