-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
So special cells needs only one group of braces.
- Loading branch information
Showing
6 changed files
with
80 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
\ProvidesExplPackage {zutil} {2024-11-15} {0.1} | ||
{Z's utilities, l3seq part} | ||
|
||
%% | ||
%% l3seq extras | ||
%% | ||
\msg_new:nnnn { zutil } { seq/empty-delimiter } | ||
{ Empty~delimiter~is~not~supported~in~#1. } | ||
{ I~will~skip~setting~#2. } | ||
|
||
\cs_new_protected:Npn \zutil_seq_set_split_keep_braces:Nnn #1 | ||
{ | ||
\__zutil_seq_set_split:NNNNnn | ||
\__kernel_tl_set:Nx \__zutil_seq_trim_spaces:n #1 | ||
\zutil_seq_set_split_keep_braces:Nnn | ||
} | ||
\cs_generate_variant:Nn \zutil_seq_set_split_keep_braces:Nnn { NnV } | ||
|
||
% This implementation is quicker than adding another \prg_do_nothing: | ||
% and \exp_args:No trick to \__zutil_seq_set_split:Nw and | ||
% \__zutil_seq_set_split:w, resp. | ||
\cs_new:Npn \__zutil_seq_trim_spaces:n #1 { { \tl_trim_spaces:n {#1} } } | ||
|
||
% Compared to \__seq_set_split:NNNnn, a forth N-arg is added which | ||
% holds the user function, i.e. \zutil_seq_set_split_keep_braces:Nnn, | ||
% for use in error message. | ||
% | ||
% l3seq internals \__seq_set_split:Nw, \__seq_set_split_end:, and | ||
% \l__seq_internal_a_tl are used. | ||
\cs_new_protected:Npn \__zutil_seq_set_split:NNNNnn #1#2#3#4#5#6 | ||
{ | ||
\tl_if_empty:nTF {#5} | ||
{ | ||
\msg_error:nnnn { zutil } { seq/empty-delimiter } {#4} {#3} | ||
} | ||
{ | ||
\tl_set:Nn \l__seq_internal_a_tl | ||
{ | ||
\__seq_set_split:Nw #2 \prg_do_nothing: | ||
#6 | ||
\__seq_set_split_end: | ||
} | ||
\tl_replace_all:Nnn \l__seq_internal_a_tl {#5} | ||
{ | ||
\__seq_set_split_end: | ||
\__seq_set_split:Nw #2 \prg_do_nothing: | ||
} | ||
\__kernel_tl_set:Nx \l__seq_internal_a_tl { \l__seq_internal_a_tl } | ||
#1 #3 { \s__seq \l__seq_internal_a_tl } | ||
} | ||
} | ||
|