[latex3-commits] [git/LaTeX3-latex3-latex3] master: Correct usage of \exp_last_unbraced:Nf (brace second argument) (2398abb)

Bruno Le Floch bruno at le-floch.fr
Fri Apr 13 22:02:53 CEST 2018


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

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

commit 2398abb1873447ac8af26d015b0fbe6ea8d51685
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Fri Apr 13 16:02:53 2018 -0400

    Correct usage of \exp_last_unbraced:Nf (brace second argument)


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

2398abb1873447ac8af26d015b0fbe6ea8d51685
 l3experimental/l3str/l3str-convert.dtx        |   33 ++++++++++++++++---------
 l3experimental/l3str/l3str-format.dtx         |   16 +++++++-----
 l3kernel/l3tl.dtx                             |    2 +-
 l3trial/l3str-format-new/l3str-format-new.dtx |    2 +-
 4 files changed, 33 insertions(+), 20 deletions(-)

diff --git a/l3experimental/l3str/l3str-convert.dtx b/l3experimental/l3str/l3str-convert.dtx
index 3b30d19..77692a5 100644
--- a/l3experimental/l3str/l3str-convert.dtx
+++ b/l3experimental/l3str/l3str-convert.dtx
@@ -1856,11 +1856,14 @@
 \flag_clear_new:n { str_overflow }
 \__kernel_msg_new:nnnn { str } { utf8-decode }
   {
-    Invalid~UTF-8~string: \exp_last_unbraced:Nf \use_none:n
-    \@@_if_flag_times:nT { str_missing }  { ,~missing~continuation~byte }
-    \@@_if_flag_times:nT { str_extra }    { ,~extra~continuation~byte }
-    \@@_if_flag_times:nT { str_overlong } { ,~overlong~form }
-    \@@_if_flag_times:nT { str_overflow } { ,~code~point~too~large }
+    Invalid~UTF-8~string:
+    \exp_last_unbraced:Nf \use_none:n
+      {
+        \@@_if_flag_times:nT { str_missing }  { ,~missing~continuation~byte }
+        \@@_if_flag_times:nT { str_extra }    { ,~extra~continuation~byte }
+        \@@_if_flag_times:nT { str_overlong } { ,~overlong~form }
+        \@@_if_flag_times:nT { str_overflow } { ,~code~point~too~large }
+      }
     .
   }
   {
@@ -2178,10 +2181,13 @@
     }
   \__kernel_msg_new:nnnn { str } { utf16-decode }
     {
-      Invalid~UTF-16~string: \exp_last_unbraced:Nf \use_none:n
-      \@@_if_flag_times:nT { str_missing }  { ,~missing~trail~surrogate }
-      \@@_if_flag_times:nT { str_extra }    { ,~extra~trail~surrogate }
-      \@@_if_flag_times:nT { str_end }      { ,~odd~number~of~bytes }
+      Invalid~UTF-16~string:
+      \exp_last_unbraced:Nf \use_none:n
+        {
+          \@@_if_flag_times:nT { str_missing }  { ,~missing~trail~surrogate }
+          \@@_if_flag_times:nT { str_extra }    { ,~extra~trail~surrogate }
+          \@@_if_flag_times:nT { str_end }      { ,~odd~number~of~bytes }
+        }
       .
     }
     {
@@ -2470,9 +2476,12 @@
   \flag_clear_new:n { str_end }
   \__kernel_msg_new:nnnn { str } { utf32-decode }
     {
-      Invalid~UTF-32~string: \exp_last_unbraced:Nf \use_none:n
-      \@@_if_flag_times:nT { str_overflow } { ,~code~point~too~large }
-      \@@_if_flag_times:nT { str_end }      { ,~truncated~string }
+      Invalid~UTF-32~string:
+      \exp_last_unbraced:Nf \use_none:n
+        {
+          \@@_if_flag_times:nT { str_overflow } { ,~code~point~too~large }
+          \@@_if_flag_times:nT { str_end }      { ,~truncated~string }
+        }
       .
     }
     {
diff --git a/l3experimental/l3str/l3str-format.dtx b/l3experimental/l3str/l3str-format.dtx
index 1f74e31..74673f8 100644
--- a/l3experimental/l3str/l3str-format.dtx
+++ b/l3experimental/l3str/l3str-format.dtx
@@ -251,7 +251,7 @@
 \cs_new:Npn \@@_format_parse:n #1
   {
     \exp_last_unbraced:Nf \@@_format_parse_auxi:NN
-      \__kernel_str_to_other:n {#1} \s_stop \s_stop {#1}
+      { \__kernel_str_to_other:n {#1} } \s_stop \s_stop {#1}
   }
 \cs_new:Npx \@@_format_parse_auxi:NN #1#2
   {
@@ -816,7 +816,7 @@
       }
       {
         \exp_last_unbraced:Nf \@@_format_fp_e_aux:wn
-          \@@_format_fp_round:wn \s__fp \__fp_chk:w #1#2#3 ; { #4 + 1 }
+          { \@@_format_fp_round:wn \s__fp \__fp_chk:w #1#2#3 ; { #4 + 1 } }
           {#4}
       }
   }
@@ -856,8 +856,10 @@
       }
       {
         \exp_last_unbraced:Nf \@@_format_fp_f_aux:wwwn
-          \fp_to_decimal:n
-            { abs ( round ( \s__fp \__fp_chk:w #1#2#3 ; , #4 ) ) }
+          {
+            \fp_to_decimal:n
+              { abs ( round ( \s__fp \__fp_chk:w #1#2#3 ; , #4 ) ) }
+          }
           . . ;
           {#4}
       }
@@ -895,8 +897,10 @@
       }
       {
         \exp_last_unbraced:Nf \@@_format_fp_g_aux:wn
-          \@@_format_fp_round:wn \s__fp \__fp_chk:w #1#2 ;
-            { \int_max:nn {1} {#3} }
+          {
+            \@@_format_fp_round:wn \s__fp \__fp_chk:w #1#2 ;
+              { \int_max:nn {1} {#3} }
+          }
           { \int_max:nn {1} {#3} }
       }
   }
diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index 61f189a..4cba6e3 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -1631,7 +1631,7 @@
           \int_compare:nNnT
             {
               \char_value_catcode:n
-                { \exp_last_unbraced:Nf ` \str_head:n {#2} ~ }
+                { \exp_last_unbraced:Nf ` { \str_head:n {#2} } ~ }
             }
             = { 10 } { ~ }
           \exp_after:wN \@@_rescan:w
diff --git a/l3trial/l3str-format-new/l3str-format-new.dtx b/l3trial/l3str-format-new/l3str-format-new.dtx
index 98dfc56..db63d3c 100644
--- a/l3trial/l3str-format-new/l3str-format-new.dtx
+++ b/l3trial/l3str-format-new/l3str-format-new.dtx
@@ -1062,7 +1062,7 @@
 \cs_new:Npn \@@_format_python:n #1
   {
     \exp_last_unbraced:Nf \@@_format_python_auxi:NN
-      \__kernel_str_to_other:n {#1} \s_stop \s_stop {#1}
+      { \__kernel_str_to_other:n {#1} } \s_stop \s_stop {#1}
   }
 \cs_new:Npx \@@_format_python_auxi:NN #1#2
   {





More information about the latex3-commits mailing list