[latex3-commits] [git/LaTeX3-latex3-latex3] master: Use a private internal for coffin-to-value (6542086)
Joseph Wright
joseph.wright at morningstar2.co.uk
Fri Mar 16 09:53:27 CET 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/65420861bb93aefb3fdda3dcecc0479cab4bb2fc
>---------------------------------------------------------------
commit 65420861bb93aefb3fdda3dcecc0479cab4bb2fc
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Fri Mar 16 08:53:27 2018 +0000
Use a private internal for coffin-to-value
>---------------------------------------------------------------
65420861bb93aefb3fdda3dcecc0479cab4bb2fc
l3kernel/l3coffins.dtx | 78 +++++++++++++++++--------------
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, 54 insertions(+), 34 deletions(-)
diff --git a/l3kernel/l3coffins.dtx b/l3kernel/l3coffins.dtx
index 42b8793..c293c85 100644
--- a/l3kernel/l3coffins.dtx
+++ b/l3kernel/l3coffins.dtx
@@ -448,6 +448,16 @@
% placing material in them. This all relies on the following data
% structures.
%
+% \begin{macro}[EXP]{\@@_to_value:N}
+% Coffins are a two-part structure and we rely on the internal nature of
+% box allocation to make everything work. As such, we need an interface
+% to turn coffin identifiers into numbers. For the purposes here, the
+% signature allowed is |N| despite the nature of the underlying primitive.
+% \begin{macrocode}
+\cs_new_eq:NN \@@_to_value:N \tex_number:D
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[EXP, pTF]{\coffin_if_exist:N, \coffin_if_exist:c}
% Several of the higher-level coffin functions would give multiple
% errors if the coffin does not exist. A cleaner way to handle this
@@ -458,7 +468,7 @@
{
\cs_if_exist:NTF #1
{
- \cs_if_exist:cTF { l_@@_poles_ \__int_value:w #1 _prop }
+ \cs_if_exist:cTF { l_@@_poles_ \@@_to_value:N #1 _prop }
{ \prg_return_true: }
{ \prg_return_false: }
}
@@ -516,11 +526,11 @@
{
\box_new:N #1
\debug_suspend:
- \prop_clear_new:c { l_@@_corners_ \__int_value:w #1 _prop }
- \prop_clear_new:c { l_@@_poles_ \__int_value:w #1 _prop }
- \prop_gset_eq:cN { l_@@_corners_ \__int_value:w #1 _prop }
+ \prop_clear_new:c { l_@@_corners_ \@@_to_value:N #1 _prop }
+ \prop_clear_new:c { l_@@_poles_ \@@_to_value:N #1 _prop }
+ \prop_gset_eq:cN { l_@@_corners_ \@@_to_value:N #1 _prop }
\c_@@_corners_prop
- \prop_gset_eq:cN { l_@@_poles_ \__int_value:w #1 _prop }
+ \prop_gset_eq:cN { l_@@_poles_ \@@_to_value:N #1 _prop }
\c_@@_poles_prop
\debug_resume:
}
@@ -732,7 +742,7 @@
\cs_new_protected:Npn \@@_get_pole:NnN #1#2#3
{
\prop_get:cnNF
- { l_@@_poles_ \__int_value:w #1 _prop } {#2} #3
+ { l_@@_poles_ \@@_to_value:N #1 _prop } {#2} #3
{
\__kernel_msg_error:nnxx { kernel } { unknown-coffin-pole }
{#2} { \token_to_str:N #1 }
@@ -747,9 +757,9 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_reset_structure:N #1
{
- \prop_set_eq:cN { l_@@_corners_ \__int_value:w #1 _prop }
+ \prop_set_eq:cN { l_@@_corners_ \@@_to_value:N #1 _prop }
\c_@@_corners_prop
- \prop_set_eq:cN { l_@@_poles_ \__int_value:w #1 _prop }
+ \prop_set_eq:cN { l_@@_poles_ \@@_to_value:N #1 _prop }
\c_@@_poles_prop
}
% \end{macrocode}
@@ -761,17 +771,17 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_eq_structure:NN #1#2
{
- \prop_set_eq:cc { l_@@_corners_ \__int_value:w #1 _prop }
- { l_@@_corners_ \__int_value:w #2 _prop }
- \prop_set_eq:cc { l_@@_poles_ \__int_value:w #1 _prop }
- { l_@@_poles_ \__int_value:w #2 _prop }
+ \prop_set_eq:cc { l_@@_corners_ \@@_to_value:N #1 _prop }
+ { l_@@_corners_ \@@_to_value:N #2 _prop }
+ \prop_set_eq:cc { l_@@_poles_ \@@_to_value:N #1 _prop }
+ { l_@@_poles_ \@@_to_value:N #2 _prop }
}
\cs_new_protected:Npn \@@_gset_eq_structure:NN #1#2
{
- \prop_gset_eq:cc { l_@@_corners_ \__int_value:w #1 _prop }
- { l_@@_corners_ \__int_value:w #2 _prop }
- \prop_gset_eq:cc { l_@@_poles_ \__int_value:w #1 _prop }
- { l_@@_poles_ \__int_value:w #2 _prop }
+ \prop_gset_eq:cc { l_@@_corners_ \@@_to_value:N #1 _prop }
+ { l_@@_corners_ \@@_to_value:N #2 _prop }
+ \prop_gset_eq:cc { l_@@_poles_ \@@_to_value:N #1 _prop }
+ { l_@@_poles_ \@@_to_value:N #2 _prop }
}
% \end{macrocode}
% \end{macro}
@@ -808,7 +818,7 @@
}
}
\cs_new_protected:Npn \@@_set_pole:Nnn #1#2#3
- { \prop_put:cnn { l_@@_poles_ \__int_value:w #1 _prop } {#2} {#3} }
+ { \prop_put:cnn { l_@@_poles_ \@@_to_value:N #1 _prop } {#2} {#3} }
\cs_generate_variant:Nn \coffin_set_horizontal_pole:Nnn { c }
\cs_generate_variant:Nn \coffin_set_vertical_pole:Nnn { c }
\cs_generate_variant:Nn \@@_set_pole:Nnn { Nnx }
@@ -824,13 +834,13 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_update_corners:N #1
{
- \prop_put:cnx { l_@@_corners_ \__int_value:w #1 _prop } { tl }
+ \prop_put:cnx { l_@@_corners_ \@@_to_value:N #1 _prop } { tl }
{ { 0pt } { \dim_eval:n { \box_ht:N #1 } } }
- \prop_put:cnx { l_@@_corners_ \__int_value:w #1 _prop } { tr }
+ \prop_put:cnx { l_@@_corners_ \@@_to_value:N #1 _prop } { tr }
{ { \dim_eval:n { \box_wd:N #1 } } { \dim_eval:n { \box_ht:N #1 } } }
- \prop_put:cnx { l_@@_corners_ \__int_value:w #1 _prop } { bl }
+ \prop_put:cnx { l_@@_corners_ \@@_to_value:N #1 _prop } { bl }
{ { 0pt } { \dim_eval:n { -\box_dp:N #1 } } }
- \prop_put:cnx { l_@@_corners_ \__int_value:w #1 _prop } { br }
+ \prop_put:cnx { l_@@_corners_ \@@_to_value:N #1 _prop } { br }
{ { \dim_eval:n { \box_wd:N #1 } } { \dim_eval:n { -\box_dp:N #1 } } }
}
% \end{macrocode}
@@ -845,31 +855,31 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_update_poles:N #1
{
- \prop_put:cnx { l_@@_poles_ \__int_value:w #1 _prop } { hc }
+ \prop_put:cnx { l_@@_poles_ \@@_to_value:N #1 _prop } { hc }
{
{ \dim_eval:n { 0.5 \box_wd:N #1 } }
{ 0pt } { 0pt } { 1000pt }
}
- \prop_put:cnx { l_@@_poles_ \__int_value:w #1 _prop } { r }
+ \prop_put:cnx { l_@@_poles_ \@@_to_value:N #1 _prop } { r }
{
{ \dim_eval:n { \box_wd:N #1 } }
{ 0pt } { 0pt } { 1000pt }
}
- \prop_put:cnx { l_@@_poles_ \__int_value:w #1 _prop } { vc }
+ \prop_put:cnx { l_@@_poles_ \@@_to_value:N #1 _prop } { vc }
{
{ 0pt }
{ \dim_eval:n { ( \box_ht:N #1 - \box_dp:N #1 ) / 2 } }
{ 1000pt }
{ 0pt }
}
- \prop_put:cnx { l_@@_poles_ \__int_value:w #1 _prop } { t }
+ \prop_put:cnx { l_@@_poles_ \@@_to_value:N #1 _prop } { t }
{
{ 0pt }
{ \dim_eval:n { \box_ht:N #1 } }
{ 1000pt }
{ 0pt }
}
- \prop_put:cnx { l_@@_poles_ \__int_value:w #1 _prop } { b }
+ \prop_put:cnx { l_@@_poles_ \@@_to_value:N #1 _prop } { b }
{
{ 0pt }
{ \dim_eval:n { -\box_dp:N #1 } }
@@ -1115,7 +1125,7 @@
% \begin{macrocode}
\@@_reset_structure:N \l_@@_aligned_coffin
\prop_clear:c
- { l_@@_corners_ \__int_value:w \l_@@_aligned_coffin _ prop }
+ { l_@@_corners_ \@@_to_value:N \l_@@_aligned_coffin _ prop }
\@@_update_poles:N \l_@@_aligned_coffin
% \end{macrocode}
% The structures of the parent coffins are now transferred to the new
@@ -1165,8 +1175,8 @@
\box_set_wd:Nn \l_@@_aligned_coffin { \box_wd:N #1 }
\@@_reset_structure:N \l_@@_aligned_coffin
\prop_set_eq:cc
- { l_@@_corners_ \__int_value:w \l_@@_aligned_coffin _prop }
- { l_@@_corners_ \__int_value:w #1 _prop }
+ { l_@@_corners_ \@@_to_value:N \l_@@_aligned_coffin _prop }
+ { l_@@_corners_ \@@_to_value:N #1 _prop }
\@@_update_poles:N \l_@@_aligned_coffin
\@@_offset_poles:Nnn #1 { 0pt } { 0pt }
\@@_offset_poles:Nnn #4
@@ -1235,7 +1245,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_offset_poles:Nnn #1#2#3
{
- \prop_map_inline:cn { l_@@_poles_ \__int_value:w #1 _prop }
+ \prop_map_inline:cn { l_@@_poles_ \@@_to_value:N #1 _prop }
{ \@@_offset_pole:Nnnnnnn #1 {##1} ##2 {#2} {#3} }
}
\cs_new_protected:Npn \@@_offset_pole:Nnnnnnn #1#2#3#4#5#6#7#8
@@ -1264,13 +1274,13 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_offset_corners:Nnn #1#2#3
{
- \prop_map_inline:cn { l_@@_corners_ \__int_value:w #1 _prop }
+ \prop_map_inline:cn { l_@@_corners_ \@@_to_value:N #1 _prop }
{ \@@_offset_corner:Nnnnn #1 {##1} ##2 {#2} {#3} }
}
\cs_new_protected:Npn \@@_offset_corner:Nnnnn #1#2#3#4#5#6
{
\prop_put:cnx
- { l_@@_corners_ \__int_value:w \l_@@_aligned_coffin _prop }
+ { l_@@_corners_ \@@_to_value:N \l_@@_aligned_coffin _prop }
{ #1 - #2 }
{
{ \dim_eval:n { #3 + #5 } }
@@ -1538,7 +1548,7 @@
%</package>
}
\prop_set_eq:Nc \l_@@_display_poles_prop
- { l_@@_poles_ \__int_value:w #1 _prop }
+ { l_@@_poles_ \@@_to_value:N #1 _prop }
\@@_get_pole:NnN #1 { H } \l_@@_pole_a_tl
\@@_get_pole:NnN #1 { T } \l_@@_pole_b_tl
\tl_if_eq:NNT \l_@@_pole_a_tl \l_@@_pole_b_tl
@@ -1682,7 +1692,7 @@
}
{
\prop_map_function:cN
- { l_@@_poles_ \int_eval:n {#2} _prop }
+ { l_@@_poles_ \@@_to_value:N #2 _prop }
\msg_show_item_unbraced:nn
}
{ }
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 883e63d..625ac82 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -5508,6 +5508,7 @@ Defining \l__coffin_x_prime_dim on line ...
\l__coffin_x_prime_dim=\dimen...
Defining \l__coffin_y_prime_dim on line ...
\l__coffin_y_prime_dim=\dimen...
+Defining \__coffin_to_value:N on line ...
Defining \coffin_if_exist_p:N on line ...
Defining \coffin_if_exist:NT on line ...
Defining \coffin_if_exist:NF on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 4f7411b..bbdafa9 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -5447,6 +5447,7 @@ Defining \l__coffin_x_prime_dim on line ...
\l__coffin_x_prime_dim=\dimen...
Defining \l__coffin_y_prime_dim on line ...
\l__coffin_y_prime_dim=\dimen...
+Defining \__coffin_to_value:N on line ...
Defining \coffin_if_exist_p:N on line ...
Defining \coffin_if_exist:NT on line ...
Defining \coffin_if_exist:NF on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 251c629..ff1cd21 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5447,6 +5447,7 @@ Defining \l__coffin_x_prime_dim on line ...
\l__coffin_x_prime_dim=\dimen...
Defining \l__coffin_y_prime_dim on line ...
\l__coffin_y_prime_dim=\dimen...
+Defining \__coffin_to_value:N on line ...
Defining \coffin_if_exist_p:N on line ...
Defining \coffin_if_exist:NT on line ...
Defining \coffin_if_exist:NF on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index f159517..21e9b5b 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -5445,6 +5445,7 @@ Defining \l__coffin_x_prime_dim on line ...
\l__coffin_x_prime_dim=\dimen...
Defining \l__coffin_y_prime_dim on line ...
\l__coffin_y_prime_dim=\dimen...
+Defining \__coffin_to_value:N on line ...
Defining \coffin_if_exist_p:N on line ...
Defining \coffin_if_exist:NT on line ...
Defining \coffin_if_exist:NF on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 7ca9766..87a156d 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -5485,6 +5485,7 @@ Defining \l__coffin_x_prime_dim on line ...
\l__coffin_x_prime_dim=\dimen...
Defining \l__coffin_y_prime_dim on line ...
\l__coffin_y_prime_dim=\dimen...
+Defining \__coffin_to_value:N on line ...
Defining \coffin_if_exist_p:N on line ...
Defining \coffin_if_exist:NT on line ...
Defining \coffin_if_exist:NF on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 883e63d..625ac82 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -5508,6 +5508,7 @@ Defining \l__coffin_x_prime_dim on line ...
\l__coffin_x_prime_dim=\dimen...
Defining \l__coffin_y_prime_dim on line ...
\l__coffin_y_prime_dim=\dimen...
+Defining \__coffin_to_value:N on line ...
Defining \coffin_if_exist_p:N on line ...
Defining \coffin_if_exist:NT on line ...
Defining \coffin_if_exist:NF on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 4f7411b..bbdafa9 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -5447,6 +5447,7 @@ Defining \l__coffin_x_prime_dim on line ...
\l__coffin_x_prime_dim=\dimen...
Defining \l__coffin_y_prime_dim on line ...
\l__coffin_y_prime_dim=\dimen...
+Defining \__coffin_to_value:N on line ...
Defining \coffin_if_exist_p:N on line ...
Defining \coffin_if_exist:NT on line ...
Defining \coffin_if_exist:NF on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 251c629..ff1cd21 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5447,6 +5447,7 @@ Defining \l__coffin_x_prime_dim on line ...
\l__coffin_x_prime_dim=\dimen...
Defining \l__coffin_y_prime_dim on line ...
\l__coffin_y_prime_dim=\dimen...
+Defining \__coffin_to_value:N on line ...
Defining \coffin_if_exist_p:N on line ...
Defining \coffin_if_exist:NT on line ...
Defining \coffin_if_exist:NF on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index f159517..21e9b5b 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -5445,6 +5445,7 @@ Defining \l__coffin_x_prime_dim on line ...
\l__coffin_x_prime_dim=\dimen...
Defining \l__coffin_y_prime_dim on line ...
\l__coffin_y_prime_dim=\dimen...
+Defining \__coffin_to_value:N on line ...
Defining \coffin_if_exist_p:N on line ...
Defining \coffin_if_exist:NT on line ...
Defining \coffin_if_exist:NF on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 7ca9766..87a156d 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -5485,6 +5485,7 @@ Defining \l__coffin_x_prime_dim on line ...
\l__coffin_x_prime_dim=\dimen...
Defining \l__coffin_y_prime_dim on line ...
\l__coffin_y_prime_dim=\dimen...
+Defining \__coffin_to_value:N on line ...
Defining \coffin_if_exist_p:N on line ...
Defining \coffin_if_exist:NT on line ...
Defining \coffin_if_exist:NF on line ...
More information about the latex3-commits
mailing list