Skip to content

Commit

Permalink
Avoid a \tex_lowercase:D in favor of a bit more expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Le Floch committed Nov 29, 2017
1 parent 3a1444c commit fef7fec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions l3experimental/l3str/l3str-convert.dtx
Expand Up @@ -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:
{
Expand All @@ -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
Expand Down

0 comments on commit fef7fec

Please sign in to comment.