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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
%%
%% This is file `l3toks.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% l3toks.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: l3toks.dtx Copyright (C) 1990-2010 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/svnroot/experimental/trunk/
%%
%% 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: l3toks.dtx 1933 2010-05-25 00:26:38Z will $
{L3 Experimental Token Registers}
\ProvidesExplPackage
{\filename}{\filedate}{\fileversion}{\filedescription}
\package_check_loaded_expl:
\cs_new_protected_nopar:Npn \toks_new:N #1 {
\chk_if_free_cs:N #1
\newtoks #1
}
\cs_generate_variant:Nn \toks_new:N {c}
\cs_new_eq:NN \toks_use:N \tex_the:D
\cs_generate_variant:Nn \toks_use:N {c}
\cs_new_eq:NN \toks_set:Nn \prg_do_nothing:
\cs_new_protected:Npn \toks_set:NV #1#2 {
#1 \exp_after:wN { \int_to_roman:w -`0 \exp_eval_register:N #2 }
}
\cs_new_protected:Npn \toks_set:Nv #1#2 {
#1 \exp_after:wN { \int_to_roman:w -`0 \exp_eval_register:c {#2} }
}
\cs_new_protected:Npn \toks_set:No #1#2 { #1 \exp_after:wN {#2} }
\cs_new_protected:Npn \toks_set:Nf #1#2 {
#1 \exp_after:wN { \int_to_roman:w -`0#2 }
}
\cs_generate_variant:Nn \toks_set:Nn {Nx,cn,cV,cv,co,cx,cf}
\cs_new_eq:NN \toks_gset:Nn \pref_global:D
\cs_generate_variant:Nn \toks_gset:Nn {NV,No,Nx,cn,cV,co,cx}
\cs_new_eq:NN \toks_set_eq:NN \prg_do_nothing:
\cs_new_eq:NN \toks_gset_eq:NN \pref_global:D
\cs_generate_variant:Nn \toks_set_eq:NN {Nc,cN,cc}
\cs_generate_variant:Nn \toks_gset_eq:NN {Nc,cN,cc}
\cs_new_protected_nopar:Npn \toks_clear:N #1 {
#1\c_empty_toks
}
\cs_new_protected_nopar:Npn \toks_gclear:N {
\pref_global:D
\toks_clear:N
}
\cs_generate_variant:Nn \toks_clear:N {c}
\cs_generate_variant:Nn \toks_gclear:N {c}
\cs_new_protected_nopar:Npn \toks_use_clear:N #1 {
\exp_last_unbraced:NNV \toks_clear:N #1 #1
}
\cs_new_protected_nopar:Npn \toks_use_gclear:N {
\pref_global:D
\toks_use_clear:N
}
\cs_generate_variant:Nn \toks_use_clear:N {c}
\cs_generate_variant:Nn \toks_use_gclear:N {c}
\cs_new_eq:NN \toks_show:N \kernel_register_show:N
\cs_generate_variant:Nn \toks_show:N {c}
\cs_new_protected_nopar:Npn \toks_put_left:Nn #1 {
\exp_after:wN \toks_put_left_aux:w \exp_after:wN \q_mark
\toks_use:N #1 \q_stop #1
}
\cs_generate_variant:Nn \toks_put_left:Nn {NV,No,Nx,cn,co,cV}
\cs_new_protected_nopar:Npn \toks_gput_left:Nn {
\pref_global:D
\toks_put_left:Nn
}
\cs_generate_variant:Nn \toks_gput_left:Nn {NV,No,Nx,cn,cV,co}
\cs_new:Npn \toks_put_left_aux:w #1\q_stop #2#3 {
#2 \exp_after:wN { \use_i:nn {#3} #1 }
}
\cs_new_protected:Npn \toks_put_right:Nn #1#2 {
#1 \exp_after:wN { \toks_use:N #1 #2 }
}
\cs_new_protected_nopar:Npn \toks_gput_right:Nn {
\pref_global:D
\toks_put_right:Nn
}
\cs_new_protected:Npn \toks_put_right:NV #1#2 {
#1 \exp_after:wN \exp_after:wN \exp_after:wN {
\exp_after:wN \toks_use:N \exp_after:wN #1
\int_to_roman:w -`0 \exp_eval_register:N #2
}
}
\cs_new_protected:Npn \toks_put_right:No #1#2 {
#1 \exp_after:wN \exp_after:wN \exp_after:wN {
\exp_after:wN \toks_use:N \exp_after:wN #1 #2
}
}
\cs_generate_variant:Nn \toks_put_right:Nn {Nx,cn,cV,co}
\cs_generate_variant:Nn \toks_gput_right:Nn {NV,No,Nx,cn,cV,co}
\cs_new_protected:Npn \toks_put_right:Nf #1#2 {
#1 \exp_after:wN \exp_after:wN \exp_after:wN {
\exp_after:wN \toks_use:N \exp_after:wN #1 \int_to_roman:w -`0#2
}
}
\prg_new_conditional:Nnn \toks_if_empty:N {p,TF,T,F} {
\tl_if_empty:VTF #1 {\prg_return_true:} {\prg_return_false:}
}
\cs_generate_variant:Nn \toks_if_empty_p:N {c}
\cs_generate_variant:Nn \toks_if_empty:NTF {c}
\cs_generate_variant:Nn \toks_if_empty:NT {c}
\cs_generate_variant:Nn \toks_if_empty:NF {c}
\prg_new_conditional:Nnn \toks_if_eq:NN {p,TF,T,F} {
\tl_if_eq:xxTF {\toks_use:N #1} {\toks_use:N #2}
{\prg_return_true:} {\prg_return_false:}
}
\cs_generate_variant:Nn \toks_if_eq_p:NN {Nc,c,cc}
\cs_generate_variant:Nn \toks_if_eq:NNTF {Nc,c,cc}
\cs_generate_variant:Nn \toks_if_eq:NNT {Nc,c,cc}
\cs_generate_variant:Nn \toks_if_eq:NNF {Nc,c,cc}
\tex_toksdef:D \l_tmpa_toks = 255\scan_stop:
\toks_new:N \l_tmpb_toks
\toks_new:N \l_tmpc_toks
\toks_new:N \g_tmpa_toks
\toks_new:N \g_tmpb_toks
\toks_new:N \g_tmpc_toks
\toks_new:N \c_empty_toks
\toks_new:N \l_tl_replace_toks
%%
%%
%% End of file `l3toks.sty'.
|