[latex3-commits] [git/LaTeX3-latex3-latex3] coffins: Make \__coffin_get_pole:Nnn scope-aware (833afe0)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Jan 20 22:35:33 CET 2019


Repository : https://github.com/latex3/latex3
On branch  : coffins
Link       : https://github.com/latex3/latex3/commit/833afe0d9ff19697b45c1359c503e77a8abbd47e

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

commit 833afe0d9ff19697b45c1359c503e77a8abbd47e
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Jan 20 19:58:14 2019 +0000

    Make \__coffin_get_pole:Nnn scope-aware


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

833afe0d9ff19697b45c1359c503e77a8abbd47e
 l3kernel/l3coffins.dtx                  |   26 +++++++++++++++++++++-----
 l3kernel/testfiles/m3expl001.luatex.tlg |    1 +
 l3kernel/testfiles/m3expl001.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl001.tlg        |    1 +
 l3kernel/testfiles/m3expl001.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl001.xetex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.luatex.tlg |    1 +
 l3kernel/testfiles/m3expl003.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl003.tlg        |    1 +
 l3kernel/testfiles/m3expl003.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.xetex.tlg  |    1 +
 11 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/l3kernel/l3coffins.dtx b/l3kernel/l3coffins.dtx
index 9c5e6ed..f8de3e5 100644
--- a/l3kernel/l3coffins.dtx
+++ b/l3kernel/l3coffins.dtx
@@ -901,21 +901,37 @@
 % \subsection{Coffins: handle and pole management}
 %
 % \begin{macro}{\@@_get_pole:NnN}
+% \begin{macro}{\@@_get_pole:NnNN}
 %   A simple wrapper around the recovery of a coffin pole, with some
-%   error checking and recovery built-in.
+%   error checking and recovery built-in. Where a coffin has no scope, it
+%   must be a \enquote{new} one, and thus we use the constant poles.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_get_pole:NnN #1#2#3
   {
-    \prop_get:cnNF
-      { l_@@_poles_ \@@_to_value:N #1 _prop } {#2} #3
+    \tl_if_empty:cTF { g_@@_scope_ \@@_to_value:N #1 _tl }
+      { \@@_get_pole:NNnN \c_@@_poles_prop }
+      {
+        \exp_args:Nc \@@_get_pole:NNnN
+          {
+            \tl_use:c { g_@@_scope_ \@@_to_value:N #1 _tl }
+            _@@_poles_ \@@_to_value:N #1 _prop
+          }
+      }
+        #1 {#2} #3
+  }
+\cs_new_protected:Npn \@@_get_pole:NNnN #1#2#3#4
+  {
+    \prop_get:NnNF #1
+      {#3} #4
       {
         \__kernel_msg_error:nnxx { kernel } { unknown-coffin-pole }
-          { \exp_not:n {#2} } { \token_to_str:N #1 }
-        \tl_set:Nn #3 { { 0pt } { 0pt } { 0pt } { 0pt } }
+          { \exp_not:n {#3} } { \token_to_str:N #2 }
+        \tl_set:Nn #4 { { 0pt } { 0pt } { 0pt } { 0pt } }
       }
   }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\@@_reset_structure:N, \@@_greset_structure:N}
 % \begin{macro}{\@@_reset_structure:NNN}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 2c3e5e9..54c2b24 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -5356,6 +5356,7 @@ Defining \coffin_ht:c on line ...
 Defining \coffin_wd:N on line ...
 Defining \coffin_wd:c on line ...
 Defining \__coffin_get_pole:NnN on line ...
+Defining \__coffin_get_pole:NNnN on line ...
 Defining \__coffin_reset_structure:N on line ...
 Defining \__coffin_greset_structure:N on line ...
 Defining \__coffin_reset_structure:NNN on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index df14673..059a527 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -5652,6 +5652,7 @@ Defining \coffin_ht:c on line ...
 Defining \coffin_wd:N on line ...
 Defining \coffin_wd:c on line ...
 Defining \__coffin_get_pole:NnN on line ...
+Defining \__coffin_get_pole:NNnN on line ...
 Defining \__coffin_reset_structure:N on line ...
 Defining \__coffin_greset_structure:N on line ...
 Defining \__coffin_reset_structure:NNN on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 03f2c5a..1f7f20b 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5652,6 +5652,7 @@ Defining \coffin_ht:c on line ...
 Defining \coffin_wd:N on line ...
 Defining \coffin_wd:c on line ...
 Defining \__coffin_get_pole:NnN on line ...
+Defining \__coffin_get_pole:NNnN on line ...
 Defining \__coffin_reset_structure:N on line ...
 Defining \__coffin_greset_structure:N on line ...
 Defining \__coffin_reset_structure:NNN on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index f7e330b..0ebfa51 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -5649,6 +5649,7 @@ Defining \coffin_ht:c on line ...
 Defining \coffin_wd:N on line ...
 Defining \coffin_wd:c on line ...
 Defining \__coffin_get_pole:NnN on line ...
+Defining \__coffin_get_pole:NNnN on line ...
 Defining \__coffin_reset_structure:N on line ...
 Defining \__coffin_greset_structure:N on line ...
 Defining \__coffin_reset_structure:NNN on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 150490a..4b3ec0d 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -5367,6 +5367,7 @@ Defining \coffin_ht:c on line ...
 Defining \coffin_wd:N on line ...
 Defining \coffin_wd:c on line ...
 Defining \__coffin_get_pole:NnN on line ...
+Defining \__coffin_get_pole:NNnN on line ...
 Defining \__coffin_reset_structure:N on line ...
 Defining \__coffin_greset_structure:N on line ...
 Defining \__coffin_reset_structure:NNN on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 2c3e5e9..54c2b24 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -5356,6 +5356,7 @@ Defining \coffin_ht:c on line ...
 Defining \coffin_wd:N on line ...
 Defining \coffin_wd:c on line ...
 Defining \__coffin_get_pole:NnN on line ...
+Defining \__coffin_get_pole:NNnN on line ...
 Defining \__coffin_reset_structure:N on line ...
 Defining \__coffin_greset_structure:N on line ...
 Defining \__coffin_reset_structure:NNN on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index df14673..059a527 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -5652,6 +5652,7 @@ Defining \coffin_ht:c on line ...
 Defining \coffin_wd:N on line ...
 Defining \coffin_wd:c on line ...
 Defining \__coffin_get_pole:NnN on line ...
+Defining \__coffin_get_pole:NNnN on line ...
 Defining \__coffin_reset_structure:N on line ...
 Defining \__coffin_greset_structure:N on line ...
 Defining \__coffin_reset_structure:NNN on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 03f2c5a..1f7f20b 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5652,6 +5652,7 @@ Defining \coffin_ht:c on line ...
 Defining \coffin_wd:N on line ...
 Defining \coffin_wd:c on line ...
 Defining \__coffin_get_pole:NnN on line ...
+Defining \__coffin_get_pole:NNnN on line ...
 Defining \__coffin_reset_structure:N on line ...
 Defining \__coffin_greset_structure:N on line ...
 Defining \__coffin_reset_structure:NNN on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index f7e330b..0ebfa51 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -5649,6 +5649,7 @@ Defining \coffin_ht:c on line ...
 Defining \coffin_wd:N on line ...
 Defining \coffin_wd:c on line ...
 Defining \__coffin_get_pole:NnN on line ...
+Defining \__coffin_get_pole:NNnN on line ...
 Defining \__coffin_reset_structure:N on line ...
 Defining \__coffin_greset_structure:N on line ...
 Defining \__coffin_reset_structure:NNN on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 150490a..4b3ec0d 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -5367,6 +5367,7 @@ Defining \coffin_ht:c on line ...
 Defining \coffin_wd:N on line ...
 Defining \coffin_wd:c on line ...
 Defining \__coffin_get_pole:NnN on line ...
+Defining \__coffin_get_pole:NNnN on line ...
 Defining \__coffin_reset_structure:N on line ...
 Defining \__coffin_greset_structure:N on line ...
 Defining \__coffin_reset_structure:NNN on line ...





More information about the latex3-commits mailing list