summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3tl.sty')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3tl.sty49
1 files changed, 38 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty
index b37aa775085..463d9f6f6b7 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty
@@ -46,7 +46,7 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
-\GetIdInfo$Id: l3tl.dtx 2563 2011-08-13 12:23:59Z joseph $
+\GetIdInfo$Id: l3tl.dtx 2566 2011-08-13 22:04:42Z bruno $
{L3 Experimental token lists}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
@@ -456,22 +456,49 @@
\tl_reverse_items_aux:nw #2 \q_recursion_stop
{#1}
}
-\cs_new:Npn \tl_trim_spaces:n #1
+\cs_set:Npn \tl_tmp:w #1
{
- \etex_unexpanded:D \exp_after:wN \exp_after:wN \exp_after:wN
- { \tl_trim_spaces_exp:n {#1} }
+ \cs_new:Npn \tl_trim_spaces:n ##1
+ {
+ \etex_unexpanded:D
+ \tl_trim_spaces_aux_i:w
+ \q_mark
+ ##1
+ \q_nil
+ \q_mark #1 { }
+ \q_mark \tl_trim_spaces_aux_ii:w
+ \tl_trim_spaces_aux_iii:w
+ #1 \q_nil
+ \tl_trim_spaces_aux_iv:w
+ \q_stop
+ }
+ \cs_new:Npn \tl_trim_spaces_aux_i:w ##1 \q_mark #1 ##2 \q_mark ##3
+ {
+ ##3
+ \tl_trim_spaces_aux_i:w
+ \q_mark
+ ##2
+ \q_mark #1 {##1}
+ }
+ \cs_new:Npn \tl_trim_spaces_aux_ii:w ##1 \q_mark \q_mark ##2
+ {
+ \tl_trim_spaces_aux_iii:w
+ ##2
+ }
+ \cs_new:Npn \tl_trim_spaces_aux_iii:w ##1 #1 \q_nil ##2
+ {
+ ##2
+ ##1 \q_nil
+ \tl_trim_spaces_aux_iii:w
+ }
+ \cs_new:Npn \tl_trim_spaces_aux_iv:w ##1 \q_nil ##2 \q_stop
+ { \exp_after:wN { \use_none:n ##1 } }
}
+\tl_tmp:w { ~ }
\cs_new_protected:Npn \tl_trim_spaces:N #1
{ \tl_set:Nx #1 { \exp_after:wN \tl_trim_spaces:n \exp_after:wN {#1} } }
\cs_new_protected:Npn \tl_gtrim_spaces:N #1
{ \tl_gset:Nx #1 { \exp_after:wN \tl_trim_spaces:n \exp_after:wN {#1} } }
-\group_begin:
- \tex_catcode:D `\Q = 3 \scan_stop:
- \cs_new:Npn \tl_trim_spaces_exp:n #1
- { \tex_romannumeral:D - `0 \tl_trim_spaces_aux_i:w \exp_not:N #1 Q ~ Q }
- \cs_new:Npn \tl_trim_spaces_aux_i:w #1 ~ Q { \tl_trim_spaces_aux_ii:w #1 Q }
- \cs_new:Npn \tl_trim_spaces_aux_ii:w #1 Q #2 {#1}
-\group_end:
\cs_generate_variant:Nn \tl_trim_spaces:N { c }
\cs_generate_variant:Nn \tl_gtrim_spaces:N { c }
\cs_new:Npn \tl_head:w #1#2 \q_stop {#1}