[latex3-commits] [git/LaTeX3-latex3-latex3] main: [NFC] Change indentation to adjust to outer conditional (1569b22b0)

Marcel Fabian Krüger tex at 2krueger.de
Mon Nov 15 15:40:40 CET 2021


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/1569b22b08290f9bacbd347a7956e50ea87ac71e

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

commit 1569b22b08290f9bacbd347a7956e50ea87ac71e
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Sun Nov 14 16:39:56 2021 +0100

    [NFC] Change indentation to adjust to outer conditional


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

1569b22b08290f9bacbd347a7956e50ea87ac71e
 l3kernel/l3intarray.dtx | 476 ++++++++++++++++++++++++------------------------
 1 file changed, 238 insertions(+), 238 deletions(-)

diff --git a/l3kernel/l3intarray.dtx b/l3kernel/l3intarray.dtx
index fd7ecd8bd..36a83498c 100644
--- a/l3kernel/l3intarray.dtx
+++ b/l3kernel/l3intarray.dtx
@@ -198,7 +198,7 @@
 %
 %    \begin{macrocode}
 \cs_if_exist:NTF \@@_gset_count:Nw
-{
+  {
 %    \end{macrocode}
 %
 % \subsubsection{Allocating arrays}
@@ -206,8 +206,8 @@
 % \begin{variable}{\g_@@_table_int, \l_@@_bad_index_int}
 %   Used to differentiate intarrays in Lua and to record an invalid index.
 %    \begin{macrocode}
-\int_new:N \g_@@_table_int
-\int_new:N \l_@@_bad_index_int
+    \int_new:N \g_@@_table_int
+    \int_new:N \l_@@_bad_index_int
 %</tex>
 %    \end{macrocode}
 % \end{variable}
@@ -234,23 +234,23 @@ end, 'protected', 'global')
 %   check in \cs{intarray_new:Nn}.
 %    \begin{macrocode}
 %<*tex>
-\cs_new_protected:Npn \@@_new:N #1
-  {
-    \__kernel_chk_if_free_cs:N #1
-    \int_gincr:N \g_@@_table_int
-    \cs_gset_nopar:Npx #1 { \@@:w \int_use:N \g_@@_table_int \c_space_tl }
-  }
-\cs_new_protected:Npn \intarray_new:Nn #1#2
-  {
-    \@@_new:N #1
-    \@@_gset_count:Nw #1 \int_eval:n {#2} \scan_stop:
-    \int_compare:nNnT { \intarray_count:N #1 } < 0
+    \cs_new_protected:Npn \@@_new:N #1
       {
-        \msg_error:nnx { kernel } { negative-array-size }
-          { \intarray_count:N #1 }
+        \__kernel_chk_if_free_cs:N #1
+        \int_gincr:N \g_@@_table_int
+        \cs_gset_nopar:Npx #1 { \@@:w \int_use:N \g_@@_table_int \c_space_tl }
       }
-  }
-\cs_generate_variant:Nn \intarray_new:Nn { c }
+    \cs_new_protected:Npn \intarray_new:Nn #1#2
+      {
+        \@@_new:N #1
+        \@@_gset_count:Nw #1 \int_eval:n {#2} \scan_stop:
+        \int_compare:nNnT { \intarray_count:N #1 } < 0
+          {
+            \msg_error:nnx { kernel } { negative-array-size }
+              { \intarray_count:N #1 }
+          }
+      }
+    \cs_generate_variant:Nn \intarray_new:Nn { c }
 %</tex>
 %    \end{macrocode}
 % \end{macro}
@@ -338,7 +338,7 @@ end, 'global')
 %
 %    \begin{macrocode}
 %<*tex>
-\cs_generate_variant:Nn \intarray_count:N { c }
+    \cs_generate_variant:Nn \intarray_count:N { c }
 %</tex>
 %    \end{macrocode}
 % \end{macro}
@@ -381,17 +381,17 @@ end, 'protected', 'global')
 %   are within bounds.
 %    \begin{macrocode}
 %<*tex>
-\cs_new_protected:Npn \__kernel_intarray_gset:Nnn #1#2#3
-{ \@@_gset:w #2 #1 #3 \scan_stop: }
-\cs_new_protected:Npn \intarray_gset:Nnn #1#2#3
-  {
-    \@@_gset:wF \int_eval:n {#2} #1 \int_eval:n{#3}
+    \cs_new_protected:Npn \__kernel_intarray_gset:Nnn #1#2#3
+      { \@@_gset:w #2 #1 #3 \scan_stop: }
+    \cs_new_protected:Npn \intarray_gset:Nnn #1#2#3
       {
-        \msg_error:nnxxx { kernel } { out-of-bounds }
-          { \token_to_str:N #1 } { \int_use:N \l_@@_bad_index_int } { \intarray_count:N #1 }
+        \@@_gset:wF \int_eval:n {#2} #1 \int_eval:n{#3}
+          {
+            \msg_error:nnxxx { kernel } { out-of-bounds }
+              { \token_to_str:N #1 } { \int_use:N \l_@@_bad_index_int } { \intarray_count:N #1 }
+          }
       }
-  }
-\cs_generate_variant:Nn \intarray_gset:Nnn { c }
+    \cs_generate_variant:Nn \intarray_gset:Nnn { c }
 %</tex>
 %    \end{macrocode}
 % \end{macro}
@@ -409,7 +409,7 @@ luacmd('intarray_gzero:N', function()
 end, 'global', 'protected')
 %</lua>
 %<*tex>
-\cs_generate_variant:Nn \intarray_gzero:N { c }
+    \cs_generate_variant:Nn \intarray_gzero:N { c }
 %</tex>
 %    \end{macrocode}
 % \end{macro}
@@ -449,18 +449,18 @@ end, 'global')
 %
 %    \begin{macrocode}
 %<*tex>
-\cs_new:Npn \__kernel_intarray_item:Nn #1#2
-  { \@@_item:w #2 #1 }
-\cs_new:Npn \intarray_item:Nn #1#2
-  {
-    \@@_item:wF \int_eval:n {#2} #1
+    \cs_new:Npn \__kernel_intarray_item:Nn #1#2
+      { \@@_item:w #2 #1 }
+    \cs_new:Npn \intarray_item:Nn #1#2
       {
-        \msg_expandable_error:nnfff { kernel } { out-of-bounds }
-          { \token_to_str:N #1 } { \int_use:N \l_@@_bad_index_int } { \intarray_count:N #1 }
-        0
+        \@@_item:wF \int_eval:n {#2} #1
+          {
+            \msg_expandable_error:nnfff { kernel } { out-of-bounds }
+              { \token_to_str:N #1 } { \int_use:N \l_@@_bad_index_int } { \intarray_count:N #1 }
+            0
+          }
       }
-  }
-\cs_generate_variant:Nn \intarray_item:Nn { c }
+    \cs_generate_variant:Nn \intarray_item:Nn { c }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -468,9 +468,9 @@ end, 'global')
 % \begin{macro}{\intarray_rand_item:N, \intarray_rand_item:c}
 %   Importantly, \cs{intarray_item:Nn} only evaluates its argument once.
 %    \begin{macrocode}
-\cs_new:Npn \intarray_rand_item:N #1
-  { \intarray_item:Nn #1 { \int_rand:n { \intarray_count:N #1 } } }
-\cs_generate_variant:Nn \intarray_rand_item:N { c }
+    \cs_new:Npn \intarray_rand_item:N #1
+      { \intarray_item:Nn #1 { \int_rand:n { \intarray_count:N #1 } } }
+    \cs_generate_variant:Nn \intarray_rand_item:N { c }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -482,16 +482,16 @@ end, 'global')
 %   This is not implemented in Lua to ensure that the clist parsing is consistent
 %   with the clist module.
 %    \begin{macrocode}
-\cs_new_protected:Npn \intarray_const_from_clist:Nn #1#2
-  {
-    \@@_new:N #1
-    \int_zero:N \l_@@_loop_int
-    \clist_map_inline:nn {#2}
+    \cs_new_protected:Npn \intarray_const_from_clist:Nn #1#2
       {
-        \int_incr:N \l_@@_loop_int
-        \__kernel_intarray_gset:Nnn #1 \l_@@_loop_int { \int_eval:n {##1} } }
-  }
-\cs_generate_variant:Nn \intarray_const_from_clist:Nn { c }
+        \@@_new:N #1
+        \int_zero:N \l_@@_loop_int
+        \clist_map_inline:nn {#2}
+          {
+            \int_incr:N \l_@@_loop_int
+            \__kernel_intarray_gset:Nnn #1 \l_@@_loop_int { \int_eval:n {##1} } }
+      }
+    \cs_generate_variant:Nn \intarray_const_from_clist:Nn { c }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -504,8 +504,8 @@ end, 'global')
 %   an issue since the delimiter is always just a comma or a comma and a space.
 %   In both cases \texttt{sprint(2, ...)} provides the right catcodes.
 %    \begin{macrocode}
-\cs_new:Npn \intarray_to_clist:N #1 { \@@_to_clist:Nn #1 { , } }
-\cs_generate_variant:Nn \intarray_to_clist:N { c }
+    \cs_new:Npn \intarray_to_clist:N #1 { \@@_to_clist:Nn #1 { , } }
+    \cs_generate_variant:Nn \intarray_to_clist:N { c }
 %</tex>
 %<*lua>
 local concat = table.concat
@@ -523,11 +523,11 @@ end, 'global')
 %   Loop through part of the array.
 %    \begin{macrocode}
 %<*tex>
-\cs_new:Npn \__kernel_intarray_range_to_clist:Nnn #1#2#3
-  {
-    \@@_range_to_clist:w #1
-    \int_eval:n {#2} ~ \int_eval:n {#3} ~
-  }
+    \cs_new:Npn \__kernel_intarray_range_to_clist:Nnn #1#2#3
+      {
+        \@@_range_to_clist:w #1
+        \int_eval:n {#2} ~ \int_eval:n {#3} ~
+      }
 %</tex>
 %<*lua>
 luacmd('@@_range_to_clist:w', function()
@@ -544,10 +544,10 @@ end, 'global')
 %   Loop through part of the array. We allow additional commas at the end.
 %    \begin{macrocode}
 %<*tex>
-\cs_new_protected:Npn \__kernel_intarray_gset_range_from_clist:Nnn #1#2#3
-  {
-    \@@_gset_range:w \int_eval:w #2 #1 #3 , , \scan_stop:
-  }
+    \cs_new_protected:Npn \__kernel_intarray_gset_range_from_clist:Nnn #1#2#3
+      {
+        \@@_gset_range:w \int_eval:w #2 #1 #3 , , \scan_stop:
+      }
 %</tex>
 %<*lua>
 luacmd('@@_gset_range:w', function()
@@ -579,9 +579,9 @@ luacmd('@@_gset_range:w', function()
 %   \cs{tex_ifabsnum:D}.
 %    \begin{macrocode}
 %<*tex>
-\cs_new_protected:Npn \@@_gset_overflow_test:nw #1
-  {
-  }
+    \cs_new_protected:Npn \@@_gset_overflow_test:nw #1
+    {
+    }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -589,8 +589,8 @@ luacmd('@@_gset_range:w', function()
 %
 % Go to the false branch of the conditional above.
 %    \begin{macrocode}
-}
-{
+  }
+  {
 %    \end{macrocode}
 %
 % \subsubsection{Allocating arrays}
@@ -598,22 +598,22 @@ luacmd('@@_gset_range:w', function()
 % \begin{macro}{\@@_entry:w, \@@_count:w}
 %   We use these primitives quite a lot in this module.
 %    \begin{macrocode}
-\cs_new_eq:NN \@@_entry:w \tex_fontdimen:D
-\cs_new_eq:NN \@@_count:w \tex_hyphenchar:D
+    \cs_new_eq:NN \@@_entry:w \tex_fontdimen:D
+    \cs_new_eq:NN \@@_count:w \tex_hyphenchar:D
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{variable}{\c_@@_sp_dim}
 %   Used to convert integers to dimensions fast.
 %    \begin{macrocode}
-\dim_const:Nn \c_@@_sp_dim { 1 sp }
+    \dim_const:Nn \c_@@_sp_dim { 1 sp }
 %    \end{macrocode}
 % \end{variable}
 %
 % \begin{variable}{\g_@@_font_int}
 %   Used to assign one font per array.
 %    \begin{macrocode}
-\int_new:N \g_@@_font_int
+    \int_new:N \g_@@_font_int
 %    \end{macrocode}
 % \end{variable}
 %
@@ -629,28 +629,28 @@ luacmd('@@_gset_range:w', function()
 %   Every \texttt{intarray} must be global; it's enough to run this
 %   check in \cs{intarray_new:Nn}.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_new:N #1
-  {
-    \__kernel_chk_if_free_cs:N #1
-    \int_gincr:N \g_@@_font_int
-    \tex_global:D \tex_font:D #1
-      = cmr10~at~ \g_@@_font_int \c_@@_sp_dim \scan_stop:
-    \int_step_inline:nn { 8 }
-      { \__kernel_intarray_gset:Nnn #1 {##1} \c_zero_int }
-  }
-\cs_new_protected:Npn \intarray_new:Nn #1#2
-  {
-    \@@_new:N #1
-    \@@_count:w #1 = \int_eval:n {#2} \scan_stop:
-    \int_compare:nNnT { \intarray_count:N #1 } < 0
+    \cs_new_protected:Npn \@@_new:N #1
       {
-        \msg_error:nnx { kernel } { negative-array-size }
-          { \intarray_count:N #1 }
+        \__kernel_chk_if_free_cs:N #1
+        \int_gincr:N \g_@@_font_int
+        \tex_global:D \tex_font:D #1
+          = cmr10~at~ \g_@@_font_int \c_@@_sp_dim \scan_stop:
+        \int_step_inline:nn { 8 }
+          { \__kernel_intarray_gset:Nnn #1 {##1} \c_zero_int }
       }
-    \int_compare:nNnT { \intarray_count:N #1 } > 0
-      { \__kernel_intarray_gset:Nnn #1 { \intarray_count:N #1 } { 0 } }
-  }
-\cs_generate_variant:Nn \intarray_new:Nn { c }
+    \cs_new_protected:Npn \intarray_new:Nn #1#2
+      {
+        \@@_new:N #1
+        \@@_count:w #1 = \int_eval:n {#2} \scan_stop:
+        \int_compare:nNnT { \intarray_count:N #1 } < 0
+          {
+            \msg_error:nnx { kernel } { negative-array-size }
+              { \intarray_count:N #1 }
+          }
+        \int_compare:nNnT { \intarray_count:N #1 } > 0
+          { \__kernel_intarray_gset:Nnn #1 { \intarray_count:N #1 } { 0 } }
+      }
+    \cs_generate_variant:Nn \intarray_new:Nn { c }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -658,8 +658,8 @@ luacmd('@@_gset_range:w', function()
 % \begin{macro}[EXP]{\intarray_count:N, \intarray_count:c}
 %   Size of an array.
 %    \begin{macrocode}
-\cs_new:Npn \intarray_count:N #1 { \int_value:w \@@_count:w #1 }
-\cs_generate_variant:Nn \intarray_count:N { c }
+    \cs_new:Npn \intarray_count:N #1 { \int_value:w \@@_count:w #1 }
+    \cs_generate_variant:Nn \intarray_count:N { c }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -669,8 +669,8 @@ luacmd('@@_gset_range:w', function()
 %   Used when an item to be stored is larger than \cs{c_max_dim} in
 %   absolute value; it is replaced by $\pm\cs{c_max_dim}$.
 %    \begin{macrocode}
-\cs_new:Npn \@@_signed_max_dim:n #1
-  { \int_value:w \int_compare:nNnT {#1} < 0 { - } \c_max_dim }
+    \cs_new:Npn \@@_signed_max_dim:n #1
+      { \int_value:w \int_compare:nNnT {#1} < 0 { - } \c_max_dim }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -679,24 +679,24 @@ luacmd('@@_gset_range:w', function()
 %   bounds checking.  The |T| branch is used if |#3| is within bounds of
 %   the array |#2|.
 %    \begin{macrocode}
-\cs_new:Npn \@@_bounds:NNnTF #1#2#3
-  {
-    \if_int_compare:w 1 > #3 \exp_stop_f:
-      \@@_bounds_error:NNnw #1 #2 {#3}
-    \else:
-      \if_int_compare:w #3 > \intarray_count:N #2 \exp_stop_f:
-        \@@_bounds_error:NNnw #1 #2 {#3}
-      \fi:
-    \fi:
-    \use_i:nn
-  }
-\cs_new:Npn \@@_bounds_error:NNnw #1#2#3#4 \use_i:nn #5#6
-  {
-    #4
-    #1 { kernel } { out-of-bounds }
-      { \token_to_str:N #2 } {#3} { \intarray_count:N #2 }
-    #6
-  }
+    \cs_new:Npn \@@_bounds:NNnTF #1#2#3
+      {
+        \if_int_compare:w 1 > #3 \exp_stop_f:
+          \@@_bounds_error:NNnw #1 #2 {#3}
+        \else:
+          \if_int_compare:w #3 > \intarray_count:N #2 \exp_stop_f:
+            \@@_bounds_error:NNnw #1 #2 {#3}
+          \fi:
+        \fi:
+        \use_i:nn
+      }
+    \cs_new:Npn \@@_bounds_error:NNnw #1#2#3#4 \use_i:nn #5#6
+      {
+        #4
+        #1 { kernel } { out-of-bounds }
+          { \token_to_str:N #2 } {#3} { \intarray_count:N #2 }
+        #6
+      }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -708,48 +708,48 @@ luacmd('@@_gset_range:w', function()
 %   \cs{int_value:w}.  The user version checks the position and value
 %   are within bounds.
 %    \begin{macrocode}
-\cs_new_protected:Npn \__kernel_intarray_gset:Nnn #1#2#3
-  { \@@_entry:w #2 #1 #3 \c_@@_sp_dim }
-\cs_new_protected:Npn \intarray_gset:Nnn #1#2#3
-  {
-    \exp_after:wN \@@_gset:Nww
-    \exp_after:wN #1
-    \int_value:w \int_eval:n {#2} \exp_after:wN ;
-    \int_value:w \int_eval:n {#3} ;
-  }
-\cs_generate_variant:Nn \intarray_gset:Nnn { c }
-\cs_new_protected:Npn \@@_gset:Nww #1#2 ; #3 ;
-  {
-    \@@_bounds:NNnTF \msg_error:nnxxx #1 {#2}
+    \cs_new_protected:Npn \__kernel_intarray_gset:Nnn #1#2#3
+      { \@@_entry:w #2 #1 #3 \c_@@_sp_dim }
+    \cs_new_protected:Npn \intarray_gset:Nnn #1#2#3
       {
-        \@@_gset_overflow_test:nw {#3}
-        \__kernel_intarray_gset:Nnn #1 {#2} {#3}
+        \exp_after:wN \@@_gset:Nww
+        \exp_after:wN #1
+        \int_value:w \int_eval:n {#2} \exp_after:wN ;
+        \int_value:w \int_eval:n {#3} ;
       }
-      { }
-  }
-\cs_if_exist:NTF \tex_ifabsnum:D
-  {
-    \cs_new_protected:Npn \@@_gset_overflow_test:nw #1
+    \cs_generate_variant:Nn \intarray_gset:Nnn { c }
+    \cs_new_protected:Npn \@@_gset:Nww #1#2 ; #3 ;
       {
-        \tex_ifabsnum:D #1 > \c_max_dim
-          \exp_after:wN \@@_gset_overflow:NNnn
-        \fi:
+        \@@_bounds:NNnTF \msg_error:nnxxx #1 {#2}
+          {
+            \@@_gset_overflow_test:nw {#3}
+            \__kernel_intarray_gset:Nnn #1 {#2} {#3}
+          }
+          { }
       }
-  }
-  {
-    \cs_new_protected:Npn \@@_gset_overflow_test:nw #1
+    \cs_if_exist:NTF \tex_ifabsnum:D
       {
-        \if_int_compare:w \int_abs:n {#1} > \c_max_dim
-          \exp_after:wN \@@_gset_overflow:NNnn
-        \fi:
+        \cs_new_protected:Npn \@@_gset_overflow_test:nw #1
+          {
+            \tex_ifabsnum:D #1 > \c_max_dim
+              \exp_after:wN \@@_gset_overflow:NNnn
+            \fi:
+          }
+      }
+      {
+        \cs_new_protected:Npn \@@_gset_overflow_test:nw #1
+          {
+            \if_int_compare:w \int_abs:n {#1} > \c_max_dim
+              \exp_after:wN \@@_gset_overflow:NNnn
+            \fi:
+          }
+      }
+    \cs_new_protected:Npn \@@_gset_overflow:NNnn #1#2#3#4
+      {
+        \msg_error:nnxxxx { kernel } { overflow }
+          { \token_to_str:N #2 } {#3} {#4} {  \@@_signed_max_dim:n {#4} }
+        #1 #2 {#3} { \@@_signed_max_dim:n {#4} }
       }
-  }
-\cs_new_protected:Npn \@@_gset_overflow:NNnn #1#2#3#4
-  {
-    \msg_error:nnxxxx { kernel } { overflow }
-      { \token_to_str:N #2 } {#3} {#4} {  \@@_signed_max_dim:n {#4} }
-    #1 #2 {#3} { \@@_signed_max_dim:n {#4} }
-  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -760,16 +760,16 @@ luacmd('@@_gset_range:w', function()
 %   memory, but this is somewhat comparable to the size of the array,
 %   and it is much faster than an \cs{int_step_inline:nn} loop.
 %    \begin{macrocode}
-\cs_new_protected:Npn \intarray_gzero:N #1
-  {
-    \int_zero:N \l_@@_loop_int
-    \prg_replicate:nn { \intarray_count:N #1 }
+    \cs_new_protected:Npn \intarray_gzero:N #1
       {
-        \int_incr:N \l_@@_loop_int
-        \@@_entry:w \l_@@_loop_int #1 \c_zero_dim
+        \int_zero:N \l_@@_loop_int
+        \prg_replicate:nn { \intarray_count:N #1 }
+          {
+            \int_incr:N \l_@@_loop_int
+            \@@_entry:w \l_@@_loop_int #1 \c_zero_dim
+          }
       }
-  }
-\cs_generate_variant:Nn \intarray_gzero:N { c }
+    \cs_generate_variant:Nn \intarray_gzero:N { c }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -780,21 +780,21 @@ luacmd('@@_gset_range:w', function()
 %   \cs{int_eval:n}, namely its argument must be a \TeX{} integer
 %   suitable for \cs{int_value:w}.
 %    \begin{macrocode}
-\cs_new:Npn \__kernel_intarray_item:Nn #1#2
-  { \int_value:w \@@_entry:w #2 #1 }
-\cs_new:Npn \intarray_item:Nn #1#2
-  {
-    \exp_after:wN \@@_item:Nw
-    \exp_after:wN #1
-    \int_value:w \int_eval:n {#2} ;
-  }
-\cs_generate_variant:Nn \intarray_item:Nn { c }
-\cs_new:Npn \@@_item:Nw #1#2 ;
-  {
-    \@@_bounds:NNnTF \msg_expandable_error:nnfff #1 {#2}
-      { \__kernel_intarray_item:Nn #1 {#2} }
-      { 0 }
-  }
+    \cs_new:Npn \__kernel_intarray_item:Nn #1#2
+      { \int_value:w \@@_entry:w #2 #1 }
+    \cs_new:Npn \intarray_item:Nn #1#2
+      {
+        \exp_after:wN \@@_item:Nw
+        \exp_after:wN #1
+        \int_value:w \int_eval:n {#2} ;
+      }
+    \cs_generate_variant:Nn \intarray_item:Nn { c }
+    \cs_new:Npn \@@_item:Nw #1#2 ;
+      {
+        \@@_bounds:NNnTF \msg_expandable_error:nnfff #1 {#2}
+          { \__kernel_intarray_item:Nn #1 {#2} }
+          { 0 }
+      }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -802,9 +802,9 @@ luacmd('@@_gset_range:w', function()
 % \begin{macro}{\intarray_rand_item:N, \intarray_rand_item:c}
 %   Importantly, \cs{intarray_item:Nn} only evaluates its argument once.
 %    \begin{macrocode}
-\cs_new:Npn \intarray_rand_item:N #1
-  { \intarray_item:Nn #1 { \int_rand:n { \intarray_count:N #1 } } }
-\cs_generate_variant:Nn \intarray_rand_item:N { c }
+    \cs_new:Npn \intarray_rand_item:N #1
+      { \intarray_item:Nn #1 { \int_rand:n { \intarray_count:N #1 } } }
+    \cs_generate_variant:Nn \intarray_rand_item:N { c }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -821,21 +821,21 @@ luacmd('@@_gset_range:w', function()
 %   big, namely \cs{@@_gset_overflow_test:nw}, but not the code that
 %   checks bounds.  At the end, set the size of the intarray.
 %    \begin{macrocode}
-\cs_new_protected:Npn \intarray_const_from_clist:Nn #1#2
-  {
-    \@@_new:N #1
-    \int_zero:N \l_@@_loop_int
-    \clist_map_inline:nn {#2}
-      { \exp_args:Nf \@@_const_from_clist:nN { \int_eval:n {##1} } #1 }
-    \@@_count:w #1 \l_@@_loop_int
-  }
-\cs_generate_variant:Nn \intarray_const_from_clist:Nn { c }
-\cs_new_protected:Npn \@@_const_from_clist:nN #1#2
-  {
-    \int_incr:N \l_@@_loop_int
-    \@@_gset_overflow_test:nw {#1}
-    \__kernel_intarray_gset:Nnn #2 \l_@@_loop_int {#1}
-  }
+    \cs_new_protected:Npn \intarray_const_from_clist:Nn #1#2
+      {
+        \@@_new:N #1
+        \int_zero:N \l_@@_loop_int
+        \clist_map_inline:nn {#2}
+          { \exp_args:Nf \@@_const_from_clist:nN { \int_eval:n {##1} } #1 }
+        \@@_count:w #1 \l_@@_loop_int
+      }
+    \cs_generate_variant:Nn \intarray_const_from_clist:Nn { c }
+    \cs_new_protected:Npn \@@_const_from_clist:nN #1#2
+      {
+        \int_incr:N \l_@@_loop_int
+        \@@_gset_overflow_test:nw {#1}
+        \__kernel_intarray_gset:Nnn #2 \l_@@_loop_int {#1}
+      }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -846,25 +846,25 @@ luacmd('@@_gset_range:w', function()
 %   the leading comma with |f|-expansion.  We also use the auxiliary in
 %   \cs{intarray_show:N} with argument comma, space.
 %    \begin{macrocode}
-\cs_new:Npn \intarray_to_clist:N #1 { \@@_to_clist:Nn #1 { , } }
-\cs_generate_variant:Nn \intarray_to_clist:N { c }
-\cs_new:Npn \@@_to_clist:Nn #1#2
-  {
-    \int_compare:nNnF { \intarray_count:N #1 } = \c_zero_int
+    \cs_new:Npn \intarray_to_clist:N #1 { \@@_to_clist:Nn #1 { , } }
+    \cs_generate_variant:Nn \intarray_to_clist:N { c }
+    \cs_new:Npn \@@_to_clist:Nn #1#2
       {
-        \exp_last_unbraced:Nf \use_none:n
-          { \@@_to_clist:w 1 ; #1 {#2} \prg_break_point: }
+        \int_compare:nNnF { \intarray_count:N #1 } = \c_zero_int
+          {
+            \exp_last_unbraced:Nf \use_none:n
+              { \@@_to_clist:w 1 ; #1 {#2} \prg_break_point: }
+          }
+      }
+    \cs_new:Npn \@@_to_clist:w #1 ; #2#3
+      {
+        \if_int_compare:w #1 > \@@_count:w #2
+          \prg_break:n
+        \fi:
+        #3 \__kernel_intarray_item:Nn #2 {#1}
+        \exp_after:wN \@@_to_clist:w
+        \int_value:w \int_eval:w #1 + \c_one_int ; #2 {#3}
       }
-  }
-\cs_new:Npn \@@_to_clist:w #1 ; #2#3
-  {
-    \if_int_compare:w #1 > \@@_count:w #2
-      \prg_break:n
-    \fi:
-    #3 \__kernel_intarray_item:Nn #2 {#1}
-    \exp_after:wN \@@_to_clist:w
-    \int_value:w \int_eval:w #1 + \c_one_int ; #2 {#3}
-  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -872,50 +872,50 @@ luacmd('@@_gset_range:w', function()
 % \begin{macro}[rEXP]{\__kernel_intarray_range_to_clist:Nnn, \@@_range_to_clist:ww}
 %   Loop through part of the array.
 %    \begin{macrocode}
-\cs_new:Npn \__kernel_intarray_range_to_clist:Nnn #1#2#3
-  {
-    \exp_last_unbraced:Nf \use_none:n
+    \cs_new:Npn \__kernel_intarray_range_to_clist:Nnn #1#2#3
+      {
+        \exp_last_unbraced:Nf \use_none:n
+          {
+            \exp_after:wN \@@_range_to_clist:ww
+            \int_value:w \int_eval:w #2 \exp_after:wN ;
+            \int_value:w \int_eval:w #3 ;
+            #1 \prg_break_point:
+          }
+      }
+    \cs_new:Npn \@@_range_to_clist:ww #1 ; #2 ; #3
       {
+        \if_int_compare:w #1 > #2 \exp_stop_f:
+          \prg_break:n
+        \fi:
+        , \__kernel_intarray_item:Nn #3 {#1}
         \exp_after:wN \@@_range_to_clist:ww
-        \int_value:w \int_eval:w #2 \exp_after:wN ;
-        \int_value:w \int_eval:w #3 ;
-        #1 \prg_break_point:
+        \int_value:w \int_eval:w #1 + \c_one_int ; #2 ; #3
       }
-  }
-\cs_new:Npn \@@_range_to_clist:ww #1 ; #2 ; #3
-  {
-    \if_int_compare:w #1 > #2 \exp_stop_f:
-      \prg_break:n
-    \fi:
-    , \__kernel_intarray_item:Nn #3 {#1}
-    \exp_after:wN \@@_range_to_clist:ww
-    \int_value:w \int_eval:w #1 + \c_one_int ; #2 ; #3
-  }
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\__kernel_intarray_gset_range_from_clist:Nnn, \@@_gset_range:Nw}
 %   Loop through part of the array.
 %    \begin{macrocode}
-\cs_new_protected:Npn \__kernel_intarray_gset_range_from_clist:Nnn #1#2#3
-  {
-    \int_set:Nn \l_@@_loop_int {#2}
-    \@@_gset_range:Nw #1 #3 , , \prg_break_point:
-  }
-\cs_new_protected:Npn \@@_gset_range:Nw #1 #2 ,
-  {
-    \if_catcode:w \scan_stop: \tl_to_str:n {#2} \scan_stop:
-      \prg_break:n
-    \fi:
-    \__kernel_intarray_gset:Nnn #1 \l_@@_loop_int {#2}
-    \int_incr:N \l_@@_loop_int
-    \@@_gset_range:Nw #1
-  }
+    \cs_new_protected:Npn \__kernel_intarray_gset_range_from_clist:Nnn #1#2#3
+      {
+        \int_set:Nn \l_@@_loop_int {#2}
+        \@@_gset_range:Nw #1 #3 , , \prg_break_point:
+      }
+    \cs_new_protected:Npn \@@_gset_range:Nw #1 #2 ,
+      {
+        \if_catcode:w \scan_stop: \tl_to_str:n {#2} \scan_stop:
+          \prg_break:n
+        \fi:
+        \__kernel_intarray_gset:Nnn #1 \l_@@_loop_int {#2}
+        \int_incr:N \l_@@_loop_int
+        \@@_gset_range:Nw #1
+      }
 %    \end{macrocode}
 % \end{macro}
 %
 %    \begin{macrocode}
-}
+  }
 %    \end{macrocode}
 %
 % \subsection{Common parts}





More information about the latex3-commits mailing list.