[latex3-commits] [l3svn] branch master updated: More \tl_to_lowercase:n removal
noreply at latex-project.org
noreply at latex-project.org
Wed Mar 23 12:15:41 CET 2016
This is an automated email from the git hooks/post-receive script.
joseph pushed a commit to branch master
in repository l3svn.
The following commit(s) were added to refs/heads/master by this push:
new f12bd3e More \tl_to_lowercase:n removal
f12bd3e is described below
commit f12bd3e6eb39bb461b6d686ed2f838d98e1ab2c4
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Wed Mar 23 10:01:09 2016 +0000
More \tl_to_lowercase:n removal
A couple of \tex_lowercase:D used as there's no
alternative for 'odd' spaces, etc. Possibly one of
the \char_generate:nn uses could be too slow: need to
get some feedback.
---
l3experimental/l3str/l3str-convert.dtx | 42 +++++++++++++-------------------
1 file changed, 17 insertions(+), 25 deletions(-)
diff --git a/l3experimental/l3str/l3str-convert.dtx b/l3experimental/l3str/l3str-convert.dtx
index a00ce2b..33865dc 100644
--- a/l3experimental/l3str/l3str-convert.dtx
+++ b/l3experimental/l3str/l3str-convert.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3str-convert.dtx Copyright (C) 2013-2015 The LaTeX3 Project
+%% File: l3str-convert.dtx Copyright (C) 2013-2016 The 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
@@ -438,7 +438,7 @@
\group_begin:
\char_set_lccode:nn { `\* } { `\ }
\char_set_lccode:nn { `\A } { `\A }
-\tl_to_lowercase:n
+\tex_lowercase:D
{
\group_end:
\cs_new_protected:Npn \@@_gset_other:Nn #1#2
@@ -581,23 +581,15 @@
% an empty result for the input $-1$.
% \begin{macrocode}
\group_begin:
- \char_set_catcode_other:n { \c_zero }
- \tl_set:Nx \l_@@_internal_tl { \tl_to_str:n { 0123456789ABCDEF } }
- \exp_args:No \tl_map_inline:nn { \l_@@_internal_tl " }
- { \char_set_lccode:nn {`#1} { \c_zero } }
- \tl_map_inline:Nn \l_@@_internal_tl
- {
- \tl_map_inline:Nn \l_@@_internal_tl
- {
- \char_set_lccode:nn { \c_zero } {"#1##1}
- \tl_to_lowercase:n
- {
- \tl_const:cx
- { c_@@_byte_ \int_eval:n {"#1##1} _tl }
- { ^^@ #1 ##1 }
- }
- }
- }
+ \tl_set:Nx \l__str_internal_tl { \tl_to_str:n { 0123456789ABCDEF } }
+ \tl_map_inline:Nn \l__str_internal_tl
+ {
+ \tl_map_inline:Nn \l__str_internal_tl
+ {
+ \tl_const:cx { c__str_byte_ \int_eval:n {"#1##1} _tl }
+ { \char_generate:nn { "#1##1 } { 12 } #1 ##1 }
+ }
+ }
\group_end:
\tl_const:cn { c_@@_byte_-1_tl } { { } \use_none:n { } }
% \end{macrocode}
@@ -1145,8 +1137,8 @@
% cannot be done expandably in \TeX{}, we cannot hope to get a
% linear-time function. However, we get quite close using the
% \pkg{l3tl-build} module, which abuses \tn{toks} to reach an almost
-% linear time. Use the standard lowercase trick to produce an
-% arbitrary character from the null character, and add that character
+% linear time. We produce an arbitrary character of category code 12
+% and add that character
% to the end of the token list being built. At the end of the loop,
% put the token list together with \cs{__tl_build_end:}. Note that we
% use an \texttt{x}-expanding assignment because it is slightly
@@ -1166,8 +1158,8 @@
\cs_new_protected:Npn \@@_encode_native_loop:w #1 \s__tl #2 \s__tl
{
\use_none_delimit_by_q_stop:w #2 \q_stop
- \tex_lccode:D \l_@@_internal_int \__int_eval:w #2 \__int_eval_end:
- \tl_to_lowercase:n { \__tl_build_one:n { ^^@ } }
+ \exp_args:Nx \__tl_build_one:n
+ { \char_generate:nn {#2} {12} }
\@@_encode_native_loop:w
}
}
@@ -1683,14 +1675,14 @@
% If followed by an end-of-line character, the backslash and the
% end-of-line are ignored. If followed by anything else, the backslash
% is ignored, raising the error flag.
-%^^A Be paranoid: \tl_to_lowercase:n is unsafe.
+%^^A Be paranoid: \tex_lowercase:D is unsafe.
% \begin{macrocode}
%<*string>
\group_begin:
\char_set_lccode:nn {`\*} {`\\}
\char_set_catcode_other:N \^^J
\char_set_catcode_other:N \^^M
- \tl_to_lowercase:n
+ \tex_lowercase:D
{
\cs_new_protected_nopar:Npn \@@_convert_unescape_string:
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the latex3-commits
mailing list