[latex3-commits] [git/LaTeX3-latex3-latex3] master: Trim space around xparse processors (fixes #578) (841c0cd)

Bruno Le Floch bruno at le-floch.fr
Wed May 22 08:56:53 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/841c0cdc16125ac6836eae7250bb40e5a2e8a175

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

commit 841c0cdc16125ac6836eae7250bb40e5a2e8a175
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Wed May 22 08:56:53 2019 +0200

    Trim space around xparse processors (fixes #578)


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

841c0cdc16125ac6836eae7250bb40e5a2e8a175
 l3packages/xparse/testfiles/xparse004.luatex.tlg |    6 ++++++
 l3packages/xparse/testfiles/xparse004.lvt        |   12 +++++++++++-
 l3packages/xparse/testfiles/xparse004.tlg        |    6 ++++++
 l3packages/xparse/xparse.dtx                     |    2 +-
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/l3packages/xparse/testfiles/xparse004.luatex.tlg b/l3packages/xparse/testfiles/xparse004.luatex.tlg
index 11bf2cb..426004e 100644
--- a/l3packages/xparse/testfiles/xparse004.luatex.tlg
+++ b/l3packages/xparse/testfiles/xparse004.luatex.tlg
@@ -839,3 +839,9 @@ spelling (e.g., `I\hbox'). Otherwise just continue,
 and I'll forget about whatever was undefined.
 FALSE
 ============================================================
+============================================================
+TEST 29: Processor spaces
+============================================================
+|{a}{bcd}|
+> \box_wd:N \l_tmpa_box =0.0pt.
+============================================================
diff --git a/l3packages/xparse/testfiles/xparse004.lvt b/l3packages/xparse/testfiles/xparse004.lvt
index 3a57cff..2fd37b5 100644
--- a/l3packages/xparse/testfiles/xparse004.lvt
+++ b/l3packages/xparse/testfiles/xparse004.lvt
@@ -1,5 +1,5 @@
 %
-% Copyright (C) 2012,2014,2015,2017,2018 LaTeX3 Project
+% Copyright (C) 2012,2014,2015,2017-2019 LaTeX3 Project
 %
 \documentclass{minimal}
 \input{regression-test}
@@ -462,4 +462,14 @@
     \IfBooleanTF { } { \ERROR } { \FALSE }
     \IfBooleanF { \ERROR \ERROR } { \FALSE }
   }
+
+\TEST { Processor~spaces }
+  {
+    \hbox_set:Nn \l_tmpa_box {
+      \DeclareDocumentCommand ~ { ~ \foo ~ } ~ { ~ > ~ { ~ \SplitList ~ {,} ~ } ~ m ~ } ~ {\TYPE ~ {|#1|}}
+      \foo ~ { ~ a ~ , ~ bcd ~ }
+    }
+    \dim_log:n { \box_wd:N \l_tmpa_box }
+  }
+
 \END
diff --git a/l3packages/xparse/testfiles/xparse004.tlg b/l3packages/xparse/testfiles/xparse004.tlg
index 8adce8c..c067611 100644
--- a/l3packages/xparse/testfiles/xparse004.tlg
+++ b/l3packages/xparse/testfiles/xparse004.tlg
@@ -839,3 +839,9 @@ spelling (e.g., `I\hbox'). Otherwise just continue,
 and I'll forget about whatever was undefined.
 FALSE
 ============================================================
+============================================================
+TEST 29: Processor spaces
+============================================================
+|{a}{bcd}|
+> \box_wd:N \l_tmpa_box =0.0pt.
+============================================================
diff --git a/l3packages/xparse/xparse.dtx b/l3packages/xparse/xparse.dtx
index c9061d8..6c99907 100644
--- a/l3packages/xparse/xparse.dtx
+++ b/l3packages/xparse/xparse.dtx
@@ -1824,7 +1824,7 @@
           { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} }
         \@@_bad_def:wn
       }
-    \tl_put_right:Nn \l_@@_arg_spec_tl { > {#1} }
+    \tl_put_right:Nx \l_@@_arg_spec_tl { > { \tl_trim_spaces:n {#1} } }
     \int_decr:N \l_@@_current_arg_int
     \bool_set_false:N \l_@@_grab_expandably_bool
     \@@_normalize_arg_spec_loop:n {#2}





More information about the latex3-commits mailing list