[latex3-commits] [l3svn] r6113 - Replace a complicated use of \tex_lowercase:D by a simpler one

noreply at latex-project.org noreply at latex-project.org
Mon Sep 28 23:30:11 CEST 2015


Author: bruno
Date: 2015-09-28 23:30:11 +0200 (Mon, 28 Sep 2015)
New Revision: 6113

Modified:
   trunk/l3kernel/l3msg.dtx
Log:
Replace a complicated use of \tex_lowercase:D by a simpler one

This could use \char_generate:nn but at the moment that function
is defined in l3candidates, loaded later than l3msg.


Modified: trunk/l3kernel/l3msg.dtx
===================================================================
--- trunk/l3kernel/l3msg.dtx	2015-09-28 21:28:57 UTC (rev 6112)
+++ trunk/l3kernel/l3msg.dtx	2015-09-28 21:30:11 UTC (rev 6113)
@@ -2005,31 +2005,30 @@
 %   (with category code $7$) and keep tokens until that space character,
 %   dropping everything else until \cs{q_stop}. The \cs{exp_end:} prevents
 %   losing braces around the user-inserted text if any, and stops the
-%   expansion of \cs{exp:w}.
+%   expansion of \cs{exp:w}.  One group is used to keep the settings
+%   for \tn{lowercase} local and the other one is used to prevent
+%   |\LaTeX3~error:| from being equal to \cs{scan_stop:}.
 %    \begin{macrocode}
 \group_begin:
-\char_set_catcode_math_superscript:N \^
-\char_set_lccode:nn { `^ } { `\  }
-\char_set_lccode:nn { `L } { `L }
-\char_set_lccode:nn { `T } { `T }
-\char_set_lccode:nn { `X } { `X }
-\tex_lowercase:D
+\cs_set_protected:Npn \@@_tmp:w #1#2
   {
-    \cs_new:Npx \@@_expandable_error:n #1
+    \group_end:
+    \cs_new:Npn \@@_expandable_error:n ##1
       {
-        \exp_not:n
-          {
-            \exp:w
-            \exp_after:wN \exp_after:wN
-            \exp_after:wN \@@_expandable_error:w
-            \exp_after:wN \exp_after:wN
-            \exp_after:wN \exp_end:
-          }
-        \exp_not:N \use:n { \exp_not:c { LaTeX3~error: } ^ #1 } ^
+        \exp:w
+        \exp_after:wN \exp_after:wN
+        \exp_after:wN \@@_expandable_error:w
+        \exp_after:wN \exp_after:wN
+        \exp_after:wN \exp_end:
+        \use:n { #2 #1 ##1 } #1
       }
-    \cs_new:Npn \@@_expandable_error:w #1 ^ #2 ^ { #1 }
+    \cs_new:Npn \@@_expandable_error:w ##1 #1 ##2 #1 {##1}
   }
-\group_end:
+\group_begin:
+\char_set_catcode_math_superscript:N \^
+\char_set_lccode:nn { `^ } { `\  }
+\tex_lowercase:D
+  { \group_end: \exp_args:NNc \@@_tmp:w ^ } { LaTeX3~error: }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}



More information about the latex3-commits mailing list