[latex3-commits] [l3svn] r7081 - In inline mappings make auxiliary function be protected

noreply at latex-project.org noreply at latex-project.org
Wed Apr 12 21:19:18 CEST 2017


Author: bruno
Date: 2017-04-12 21:19:18 +0200 (Wed, 12 Apr 2017)
New Revision: 7081

Modified:
   trunk/l3kernel/l3candidates.dtx
   trunk/l3kernel/l3clist.dtx
   trunk/l3kernel/l3int.dtx
   trunk/l3kernel/l3prop.dtx
   trunk/l3kernel/l3tl.dtx
Log:
In inline mappings make auxiliary function be protected

Since the mapping itself requires various assignments it seems
sensible to make the auxiliary function be protected too, even
though it is not strictly necessary.


Modified: trunk/l3kernel/l3candidates.dtx
===================================================================
--- trunk/l3kernel/l3candidates.dtx	2017-04-12 19:01:39 UTC (rev 7080)
+++ trunk/l3kernel/l3candidates.dtx	2017-04-12 19:19:18 UTC (rev 7081)
@@ -1547,8 +1547,8 @@
 %   Mapping to an input stream can be done on either a token or a string
 %   basis, hence the set up. Within that, there is a check to avoid reading
 %   past the end of a file, hence the two applications of \cs{ior_if_eof:N}.
-%   This mapping cannot be nested as the stream has only one \enquote{current
-%   line}.
+%   This mapping cannot be nested with twice the same stream, as the
+%   stream has only one \enquote{current line}.
 %    \begin{macrocode}
 \cs_new_protected:Npn \ior_map_inline:Nn
   { \@@_map_inline:NNn \ior_get:NN }
@@ -1562,7 +1562,7 @@
   }
 \cs_new_protected:Npn \@@_map_inline:NNNn #1#2#3#4
   {
-    \cs_set:Npn #1 ##1 {#4}
+    \cs_gset_protected:Npn #1 ##1 {#4}
     \ior_if_eof:NF #3 { \@@_map_inline_loop:NNN #1#2#3 }
     \__prg_break_point:Nn \ior_map_break:
       { \int_gdecr:N \g__prg_map_int }

Modified: trunk/l3kernel/l3clist.dtx
===================================================================
--- trunk/l3kernel/l3clist.dtx	2017-04-12 19:01:39 UTC (rev 7080)
+++ trunk/l3kernel/l3clist.dtx	2017-04-12 19:19:18 UTC (rev 7081)
@@ -1553,7 +1553,8 @@
     \clist_if_empty:NF #1
       {
         \int_gincr:N \g__prg_map_int
-        \cs_gset:cpn { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
+        \cs_gset_protected:cpn
+          { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
         \exp_last_unbraced:Nco \@@_map_function:Nw
           { __prg_map_ \int_use:N \g__prg_map_int :w }
           #1 , \q_recursion_tail ,

Modified: trunk/l3kernel/l3int.dtx
===================================================================
--- trunk/l3kernel/l3int.dtx	2017-04-12 19:01:39 UTC (rev 7080)
+++ trunk/l3kernel/l3int.dtx	2017-04-12 19:19:18 UTC (rev 7081)
@@ -1757,14 +1757,14 @@
   {
     \int_gincr:N \g__prg_map_int
     \exp_args:NNc \@@_step:NNnnnn
-      \cs_gset:Npn
+      \cs_gset_protected:Npn
       { __prg_map_ \int_use:N \g__prg_map_int :w }
   }
 \cs_new_protected:Npn \int_step_variable:nnnNn #1#2#3#4#5
   {
     \int_gincr:N \g__prg_map_int
     \exp_args:NNc \@@_step:NNnnnn
-      \cs_gset:Npx
+      \cs_gset_protected:Npx
       { __prg_map_ \int_use:N \g__prg_map_int :w }
       {#1}{#2}{#3}
       {

Modified: trunk/l3kernel/l3prop.dtx
===================================================================
--- trunk/l3kernel/l3prop.dtx	2017-04-12 19:01:39 UTC (rev 7080)
+++ trunk/l3kernel/l3prop.dtx	2017-04-12 19:19:18 UTC (rev 7081)
@@ -1065,13 +1065,15 @@
 %   of the form \cs{@@_pair:wn} \meta{key} \cs{s_@@} \Arg{value}, there
 %   are a leading and a trailing tokens, but both are equal to
 %   \cs{scan_stop:}, hence have no effect in such inline mapping.
+%   Such \cs{scan_stop:} could have affected ligatures if they appeared
+%   during the mapping.
 %    \begin{macrocode}
 \cs_new_protected:Npn \prop_map_inline:Nn #1#2
   {
     \cs_gset_eq:cN
       { __prg_map_ \int_use:N \g__prg_map_int :wn } \@@_pair:wn
     \int_gincr:N \g__prg_map_int
-    \cs_gset:Npn \@@_pair:wn ##1 \s_@@ ##2 {#2}
+    \cs_gset_protected:Npn \@@_pair:wn ##1 \s_@@ ##2 {#2}
     #1
     \__prg_break_point:Nn \prop_map_break:
       {

Modified: trunk/l3kernel/l3tl.dtx
===================================================================
--- trunk/l3kernel/l3tl.dtx	2017-04-12 19:01:39 UTC (rev 7080)
+++ trunk/l3kernel/l3tl.dtx	2017-04-12 19:19:18 UTC (rev 7081)
@@ -2211,7 +2211,8 @@
 \cs_new_protected:Npn \tl_map_inline:nn #1#2
   {
     \int_gincr:N \g__prg_map_int
-    \cs_gset:cpn { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
+    \cs_gset_protected:cpn
+      { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
     \exp_args:Nc \@@_map_function:Nn
       { __prg_map_ \int_use:N \g__prg_map_int :w }
       #1 \q_recursion_tail



More information about the latex3-commits mailing list