Skip to content

Commit

Permalink
clean up code (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjr committed Dec 25, 2024
1 parent a8ff6b8 commit 64eff2a
Showing 1 changed file with 44 additions and 38 deletions.
82 changes: 44 additions & 38 deletions tabularray.sty
Original file line number Diff line number Diff line change
Expand Up @@ -855,50 +855,56 @@
}
\cs_generate_variant:Nn \__tblr_array_gadd_value:Nnn { cnn }

%%% --------------------------------------------------------
%%> \section{Switch between Different Data Structures}
%%% --------------------------------------------------------

\bool_new:N \g__tblr_use_intarray_bool
\bool_gset_true:N \g__tblr_use_intarray_bool

\AtBeginDocument
\cs_new_protected:Npn \__tblr_map_data_to_spec:
{
\bool_if:NF \g__tblr_use_intarray_bool
\cs_set_protected:Npn \__tblr_data_gput:nnnn ##1 ##2 ##3 ##4
{
\cs_set_protected:Npn \__tblr_data_gput:nnnn #1 #2 #3 #4
{
\__tblr_spec_gput:nnn {#1} { [#2] / #3 } {#4}
}
\cs_set_protected:Npn \__tblr_data_gput:nnnnn #1 #2 #3 #4 #5
{
\__tblr_spec_gput:nnn {#1} { [#2][#3] / #4 } {#5}
}
\cs_set:Npn \__tblr_data_item:nnn #1 #2 #3
{
\__tblr_spec_item:nn {#1} { [#2] / #3 }
}
\cs_set:Npn \__tblr_data_item:nnnn #1 #2 #3 #4
{
\__tblr_spec_item:nn {#1} { [#2][#3] / #4 }
}
\cs_set_protected:Npn \__tblr_data_log:n #1
{
\__tblr_spec_log:n {#1}
}
\cs_set_protected:Npn \__tblr_data_gput_if_larger:nnnn #1 #2 #3 #4
{
\__tblr_spec_gput_if_larger:nnn {#1} { [#2] / #3 } {#4}
}
\cs_set_protected:Npn \__tblr_data_gput_if_larger:nnnnn #1 #2 #3 #4 #5
{
\__tblr_spec_gput_if_larger:nnn {#1} { [#2][#3] / #4 } {#5}
}
\cs_set_protected:Npn \__tblr_data_gadd_dimen_value:nnnn #1 #2 #3 #4
{
\__tblr_spec_gadd_dimen_value:nnn {#1} { [#2] / #3 } {#4}
}
\cs_set_protected:Npn \__tblr_data_gadd_dimen_value:nnnnn #1 #2 #3 #4 #5
{
\__tblr_spec_gadd_dimen_value:nnn {#1} { [#2][#3] / #4 } {#5}
}
\__tblr_spec_gput:nnn {##1} { [##2] / ##3 } {##4}
}
\cs_set_protected:Npn \__tblr_data_gput:nnnnn ##1 ##2 ##3 ##4 ##5
{
\__tblr_spec_gput:nnn {##1} { [##2][##3] / ##4 } {##5}
}
\cs_set:Npn \__tblr_data_item:nnn ##1 ##2 ##3
{
\__tblr_spec_item:nn {##1} { [##2] / ##3 }
}
\cs_set:Npn \__tblr_data_item:nnnn ##1 ##2 ##3 ##4
{
\__tblr_spec_item:nn {##1} { [##2][##3] / ##4 }
}
\cs_set_protected:Npn \__tblr_data_log:n ##1
{
\__tblr_spec_log:n {##1}
}
\cs_set_protected:Npn \__tblr_data_gput_if_larger:nnnn ##1 ##2 ##3 ##4
{
\__tblr_spec_gput_if_larger:nnn {##1} { [##2] / ##3 } {##4}
}
\cs_set_protected:Npn \__tblr_data_gput_if_larger:nnnnn ##1 ##2 ##3 ##4 ##5
{
\__tblr_spec_gput_if_larger:nnn {##1} { [##2][##3] / ##4 } {##5}
}
\cs_set_protected:Npn \__tblr_data_gadd_dimen_value:nnnn ##1 ##2 ##3 ##4
{
\__tblr_spec_gadd_dimen_value:nnn {##1} { [##2] / ##3 } {##4}
}
\cs_set_protected:Npn \__tblr_data_gadd_dimen_value:nnnnn ##1 ##2 ##3 ##4 ##5
{
\__tblr_spec_gadd_dimen_value:nnn {##1} { [##2][##3] / ##4 } {##5}
}
}

\AtBeginDocument
{
\bool_if:NF \g__tblr_use_intarray_bool { \__tblr_map_data_to_spec: }
}

%%% --------------------------------------------------------
Expand Down

0 comments on commit 64eff2a

Please sign in to comment.