[latex3-commits] [git/LaTeX3-latex3-latex3] master: Implement \intarray_gzero:N to clear all entries in an intarray (ccfa774)

Bruno Le Floch bruno at le-floch.fr
Fri May 4 23:19:47 CEST 2018


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

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

commit ccfa774bf4f1c577699d998761ee9c430964ad55
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Fri May 4 23:13:02 2018 +0200

    Implement \intarray_gzero:N to clear all entries in an intarray


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

ccfa774bf4f1c577699d998761ee9c430964ad55
 l3kernel/l3intarray.dtx                 |   22 ++++++++++++++++++++++
 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, 32 insertions(+)

diff --git a/l3kernel/l3intarray.dtx b/l3kernel/l3intarray.dtx
index a49a046..1943c0f 100644
--- a/l3kernel/l3intarray.dtx
+++ b/l3kernel/l3intarray.dtx
@@ -70,6 +70,8 @@
 %   \end{syntax}
 %   Evaluates the integer expression \meta{size} and allocates an
 %   \meta{integer array variable} with that number of (zero) entries.
+%   The variable name should start with |\g_| because assignments are
+%   always global.
 % \end{function}
 %
 % \begin{function}[EXP, added = 2018-03-29]{\intarray_count:N}
@@ -92,6 +94,14 @@
 %   global.
 % \end{function}
 %
+% \begin{function}[added = 2018-05-04]{\intarray_gzero:N}
+%   \begin{syntax}
+%     \cs{intarray_gzero:N} \meta{intarray~var}
+%   \end{syntax}
+%   Sets all entries of the \meta{integer array variable} to zero.
+%   Assignments are always global.
+% \end{function}
+%
 % \begin{function}[EXP, added = 2018-03-29]{\intarray_item:Nn}
 %   \begin{syntax}
 %     \cs{intarray_item:Nn} \meta{intarray~var} \Arg{position}
@@ -276,6 +286,18 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}{\intarray_gzero:N}
+%   Set the appropriate \tn{fontdimen} to zero.  No bound checking
+%   needed.
+%    \begin{macrocode}
+\cs_new_protected:Npn \intarray_gzero:N #1
+  {
+    \int_step_inline:nn { \intarray_count:N #1 }
+      { \tex_fontdimen:D ##1 #1 \c_zero_dim }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}[EXP]{\intarray_item:Nn, \__kernel_intarray_item:Nn}
 % \begin{macro}{\@@_item:Nn}
 %   Get the appropriate \tn{fontdimen} and perform bound checks.  The
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 36ab1a8..73e2967 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -4232,6 +4232,7 @@ Defining \__kernel_intarray_gset:Nnn on line ...
 Defining \intarray_gset:Nnn on line ...
 Defining \__intarray_gset:Nww on line ...
 Defining \__intarray_gset_overflow:NNnn on line ...
+Defining \intarray_gzero:N on line ...
 Defining \__kernel_intarray_item:Nn on line ...
 Defining \intarray_item:Nn on line ...
 Defining \__intarray_item:Nw on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index cb219f6..cd15f31 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -4486,6 +4486,7 @@ Defining \__kernel_intarray_gset:Nnn on line ...
 Defining \intarray_gset:Nnn on line ...
 Defining \__intarray_gset:Nww on line ...
 Defining \__intarray_gset_overflow:NNnn on line ...
+Defining \intarray_gzero:N on line ...
 Defining \__kernel_intarray_item:Nn on line ...
 Defining \intarray_item:Nn on line ...
 Defining \__intarray_item:Nw on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 6bb0add..cee6080 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -4486,6 +4486,7 @@ Defining \__kernel_intarray_gset:Nnn on line ...
 Defining \intarray_gset:Nnn on line ...
 Defining \__intarray_gset:Nww on line ...
 Defining \__intarray_gset_overflow:NNnn on line ...
+Defining \intarray_gzero:N on line ...
 Defining \__kernel_intarray_item:Nn on line ...
 Defining \intarray_item:Nn on line ...
 Defining \__intarray_item:Nw on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index e8ffcae..0951cb8 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -4486,6 +4486,7 @@ Defining \__kernel_intarray_gset:Nnn on line ...
 Defining \intarray_gset:Nnn on line ...
 Defining \__intarray_gset:Nww on line ...
 Defining \__intarray_gset_overflow:NNnn on line ...
+Defining \intarray_gzero:N on line ...
 Defining \__kernel_intarray_item:Nn on line ...
 Defining \intarray_item:Nn on line ...
 Defining \__intarray_item:Nw on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index b6ba4f9..5aeb4cb 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -4206,6 +4206,7 @@ Defining \__kernel_intarray_gset:Nnn on line ...
 Defining \intarray_gset:Nnn on line ...
 Defining \__intarray_gset:Nww on line ...
 Defining \__intarray_gset_overflow:NNnn on line ...
+Defining \intarray_gzero:N on line ...
 Defining \__kernel_intarray_item:Nn on line ...
 Defining \intarray_item:Nn on line ...
 Defining \__intarray_item:Nw on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 36ab1a8..73e2967 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -4232,6 +4232,7 @@ Defining \__kernel_intarray_gset:Nnn on line ...
 Defining \intarray_gset:Nnn on line ...
 Defining \__intarray_gset:Nww on line ...
 Defining \__intarray_gset_overflow:NNnn on line ...
+Defining \intarray_gzero:N on line ...
 Defining \__kernel_intarray_item:Nn on line ...
 Defining \intarray_item:Nn on line ...
 Defining \__intarray_item:Nw on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index cb219f6..cd15f31 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -4486,6 +4486,7 @@ Defining \__kernel_intarray_gset:Nnn on line ...
 Defining \intarray_gset:Nnn on line ...
 Defining \__intarray_gset:Nww on line ...
 Defining \__intarray_gset_overflow:NNnn on line ...
+Defining \intarray_gzero:N on line ...
 Defining \__kernel_intarray_item:Nn on line ...
 Defining \intarray_item:Nn on line ...
 Defining \__intarray_item:Nw on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 6bb0add..cee6080 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -4486,6 +4486,7 @@ Defining \__kernel_intarray_gset:Nnn on line ...
 Defining \intarray_gset:Nnn on line ...
 Defining \__intarray_gset:Nww on line ...
 Defining \__intarray_gset_overflow:NNnn on line ...
+Defining \intarray_gzero:N on line ...
 Defining \__kernel_intarray_item:Nn on line ...
 Defining \intarray_item:Nn on line ...
 Defining \__intarray_item:Nw on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index e8ffcae..0951cb8 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -4486,6 +4486,7 @@ Defining \__kernel_intarray_gset:Nnn on line ...
 Defining \intarray_gset:Nnn on line ...
 Defining \__intarray_gset:Nww on line ...
 Defining \__intarray_gset_overflow:NNnn on line ...
+Defining \intarray_gzero:N on line ...
 Defining \__kernel_intarray_item:Nn on line ...
 Defining \intarray_item:Nn on line ...
 Defining \__intarray_item:Nw on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index b6ba4f9..5aeb4cb 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -4206,6 +4206,7 @@ Defining \__kernel_intarray_gset:Nnn on line ...
 Defining \intarray_gset:Nnn on line ...
 Defining \__intarray_gset:Nww on line ...
 Defining \__intarray_gset_overflow:NNnn on line ...
+Defining \intarray_gzero:N on line ...
 Defining \__kernel_intarray_item:Nn on line ...
 Defining \intarray_item:Nn on line ...
 Defining \__intarray_item:Nw on line ...





More information about the latex3-commits mailing list