[latex3-commits] [git/latex3] master: Avoid a \tex_lowercase:D in favor of a bit more expansion (fef7fec)

Bruno Le Floch bruno at le-floch.fr
Wed Nov 29 17:32:27 CET 2017


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/fef7fecf00918d5abb08d15ce179cf56fd70987b

>---------------------------------------------------------------

commit fef7fecf00918d5abb08d15ce179cf56fd70987b
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Wed Nov 29 11:32:27 2017 -0500

    Avoid a \tex_lowercase:D in favor of a bit more expansion


>---------------------------------------------------------------

fef7fecf00918d5abb08d15ce179cf56fd70987b
 l3experimental/l3str/l3str-convert.dtx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/l3experimental/l3str/l3str-convert.dtx b/l3experimental/l3str/l3str-convert.dtx
index 9873b98..6d60b1f 100644
--- a/l3experimental/l3str/l3str-convert.dtx
+++ b/l3experimental/l3str/l3str-convert.dtx
@@ -1560,14 +1560,12 @@
 %   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: \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
-  \tex_lowercase:D
+  \cs_set_protected:Npn \@@_tmp:w #1
     {
       \cs_new_protected:Npn \@@_convert_unescape_string:
         {
@@ -1584,15 +1582,17 @@
             \tl_gset:Nx \g_@@_result_tl
               {
                 \exp_after:wN \@@_unescape_string_loop:wNNN
-                  \g_@@_result_tl * ?? { ? \__prg_break: }
+                  \g_@@_result_tl #1 ?? { ? \__prg_break: }
                 \__prg_break_point:
               }
             \@@_if_flag_error:nnx { str_byte } { non-byte } { string }
             \@@_if_flag_error:nnx { str_error } { unescape-string } { }
           \group_end:
         }
-      \cs_new:Npn \@@_unescape_string_loop:wNNN #1 *#2#3#4
     }
+  \exp_args:No \@@_tmp:w { \c_backslash_str }
+  \exp_last_unbraced:NNNNo
+    \cs_new:Npn \@@_unescape_string_loop:wNNN #1 \c_backslash_str #2#3#4
         {
           \@@_filter_bytes:n {#1}
           \use_none:n #4





More information about the latex3-commits mailing list