[latex3-commits] [l3svn] r7132 - Don't try to undefine active kanji in (u)pTeX

noreply at latex-project.org noreply at latex-project.org
Fri May 12 17:21:46 CEST 2017


Author: bruno
Date: 2017-05-12 17:21:46 +0200 (Fri, 12 May 2017)
New Revision: 7132

Modified:
   trunk/l3experimental/l3str/l3tl-analysis.dtx
Log:
Don't try to undefine active kanji in (u)pTeX

As part of analysing token lists for regex manipulations,
l3tl-analysis makes sure any character in the token list that might
potentially be active is undefined.  This is done using lccode but
(u)pTeX only allows the range [0-255] for this primitive.


Modified: trunk/l3experimental/l3str/l3tl-analysis.dtx
===================================================================
--- trunk/l3experimental/l3str/l3tl-analysis.dtx	2017-05-09 19:45:35 UTC (rev 7131)
+++ trunk/l3experimental/l3str/l3tl-analysis.dtx	2017-05-12 15:21:46 UTC (rev 7132)
@@ -390,15 +390,17 @@
 %   must appear in its string representation. The string is shortened
 %   a little by making the escape character unprintable. The active
 %   space must be disabled separately (the loop skips over it otherwise),
-%   and we end the loop by feeding an odd non-\texttt{N}-type
-%   argument to the looping macro.
+%   and we end the loop by feeding an odd non-\texttt{N}-type argument
+%   to the looping macro.  For \pTeX{} and \upTeX{} we skip characters
+%   beyond $[0,255]$ because \tn{lccode} only allows those values.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_setup:n #1
   {
     \int_set:Nn \tex_escapechar:D { -1 }
     \exp_after:wN \@@_disable_loop:N
-      \tl_to_str:n {#1} { ~ } { ? ~ \__prg_break: }
+      \tl_to_str:n {#1} { ~ } { ? \__prg_break: }
     \__prg_break_point:
+    \scan_stop:
   }
 \group_begin:
   \char_set_catcode_active:N \^^@
@@ -408,6 +410,20 @@
       \tex_lowercase:D { \tex_let:D ^^@ } \tex_undefined:D
       \@@_disable_loop:N
     }
+  \bool_lazy_or:nnT
+    { \sys_if_engine_ptex_p: }
+    { \sys_if_engine_uptex_p: }
+    {
+      \cs_gset_protected:Npn \@@_disable_loop:N #1
+        {
+          \use_none:n #1 \scan_stop:
+          \if_int_compare:w 256 > `#1 \exp_stop_f:
+            \tex_lccode:D 0 = `#1 ~
+            \tex_lowercase:D { \tex_let:D ^^@ } \tex_undefined:D
+          \fi:
+          \@@_disable_loop:N
+        }
+    }
 \group_end:
 %    \end{macrocode}
 % \end{macro}



More information about the latex3-commits mailing list