Skip to content

Commit

Permalink
style(zutil): re-add comments for \zutil_seq_set_split_keep_braces:Nnn
Browse files Browse the repository at this point in the history
75b6c4d (style(zutil): add comments for \zutil_seq_set_split_keep_braces:Nnn, 2024-11-21)
was lost when merging.
  • Loading branch information
muzimuzhi committed Nov 21, 2024
1 parent c3ea49f commit fa873e8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion zutil/zutil-tblr.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
The~existing~definition~of~'#2'~will~not~be~altered.
}

% It can be defined as simple as
% %<@@=seq>
% \cs_new_protected:Npn \zutil_seq_set_split_keep_braces:Nnn
% { \@@_set_split:NNNnn \__kernel_tl_set:Nx
% \__zutil_seq_trim_spaces:n }
% so differs from \seq_set_split:Nnn and \seq_set_split_keep_spaces:Nnn
% by only the space trimming function:
% \cs_new_protected:Npn \seq_set_split:Nnn
% { \@@_set_split:NNNnn \__kernel_tl_set:Nx \tl_trim_spaces:n }
% \cs_new_protected:Npn \seq_set_split_keep_spaces:Nnn
% { \@@_set_split:NNNnn \__kernel_tl_set:Nx \exp_not:n }
% but I insist on raising an error on empty delimiter.
\cs_new_protected:Npn \zutil_seq_set_split_keep_braces:Nnn #1
{
\__zutil_seq_set_split:NNNNnn
Expand All @@ -18,6 +30,7 @@
}
\cs_generate_variant:Nn \zutil_seq_set_split_keep_braces:Nnn { NnV }

% gset version
\cs_new_protected:Npn \zutil_seq_gset_split_keep_braces:Nnn #1
{
\__zutil_seq_set_split:NNNNnn
Expand All @@ -32,7 +45,7 @@
\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,
% holds the caller, i.e. \zutil_seq_set_split_keep_braces:Nnn,
% for use in error message.
%
% l3seq internals \__seq_set_split:Nw and \l__seq_internal_a_tl, along
Expand Down

0 comments on commit fa873e8

Please sign in to comment.