Skip to content

Commit

Permalink
fix(zutil): make \zutil_cs_if_defined:(N|c)TF public
Browse files Browse the repository at this point in the history
  • Loading branch information
muzimuzhi committed Jan 8, 2025
1 parent f51e886 commit 9372926
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions tabularray/tabularray.sty
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@
\exp_args:NcV \NewDocumentCommand
{ __tblr_table_cmd_ \l__tblr_tmpa_tl :w } \l__tblr_tmpb_tl { #4 }
%% we can not use \cs_if_exist:NTF here (see issue #328)
\__zutil_cs_if_defined:NTF #1
\zutil_cs_if_defined:NTF #1
{
\cs_set_eq:cN { __tblr_table_cmd_ \l__tblr_tmpa_tl _saved:w } #1
}
Expand All @@ -927,7 +927,7 @@
}

\cs_new:Npn \__tblr_if_table_command:NTF #1
{ \__zutil_cs_if_defined:cTF { __tblr_table_cmd_ \cs_to_str:N #1 :w } }
{ \zutil_cs_if_defined:cTF { __tblr_table_cmd_ \cs_to_str:N #1 :w } }

\cs_new_protected:Npn \__tblr_enable_table_commands:
{
Expand Down
16 changes: 8 additions & 8 deletions zutil/testfiles/zutil-l3extras.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

\START

\TEST{\__zutil_cs_if_defined:NTF}{
\__zutil_cs_if_defined:NTF \zutil_set:n \TRUE \ERROR
\__zutil_cs_if_defined:NTF \scan_stop: \TRUE \ERROR
\__zutil_cs_if_defined:NTF \tex_undefined:D \ERROR \TRUE
\TEST{\zutil_cs_if_defined:NTF}{
\zutil_cs_if_defined:NTF \zutil_set:n \TRUE \ERROR
\zutil_cs_if_defined:NTF \scan_stop: \TRUE \ERROR
\zutil_cs_if_defined:NTF \tex_undefined:D \ERROR \TRUE
}

\TEST{\__zutil_cs_if_defined:cTF}{
\__zutil_cs_if_defined:cTF { zutil_set:n } \TRUE \ERROR
\__zutil_cs_if_defined:cTF { scan_stop: } \TRUE \ERROR
\__zutil_cs_if_defined:cTF { tex_undefined:D } \ERROR \TRUE
\TEST{\zutil_cs_if_defined:cTF}{
\zutil_cs_if_defined:cTF { zutil_set:n } \TRUE \ERROR
\zutil_cs_if_defined:cTF { scan_stop: } \TRUE \ERROR
\zutil_cs_if_defined:cTF { tex_undefined:D } \ERROR \TRUE
}

\OMIT
Expand Down
4 changes: 2 additions & 2 deletions zutil/testfiles/zutil-l3extras.tlg
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
============================================================
TEST: \__zutil_cs_if_defined:NTF
TEST: \zutil_cs_if_defined:NTF
============================================================
TRUE
TRUE
TRUE
============================================================
============================================================
TEST: \__zutil_cs_if_defined:cTF
TEST: \zutil_cs_if_defined:cTF
============================================================
TRUE
TRUE
Expand Down
4 changes: 2 additions & 2 deletions zutil/zutil-debug.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@

\cs_new:Npn \__zutil_debug_use:N #1
{
\__zutil_cs_if_defined:NTF #1
\zutil_cs_if_defined:NTF #1
{ \cs_replacement_spec:N #1 } { \tl_to_str:n { undefined } }
}
\cs_new:Npn \__zutil_debug_use:c #1
{
\__zutil_cs_if_defined:cTF {#1}
\zutil_cs_if_defined:cTF {#1}
{ \cs_replacement_spec:c {#1} } { \tl_to_str:n { undefined } }
}

Expand Down
4 changes: 2 additions & 2 deletions zutil/zutil-l3extras.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
%%

% Treat \relax as defined, thus different from \cs_if_exist:NTF.
\prg_set_conditional:Npnn \__zutil_cs_if_defined:N #1 { p, T, F, TF }
\prg_set_conditional:Npnn \zutil_cs_if_defined:N #1 { p, T, F, TF }
{
\if_cs_exist:N #1
\prg_return_true:
\else:
\prg_return_false:
\fi:
}
\prg_set_conditional:Npnn \__zutil_cs_if_defined:c #1 { p, T, F, TF }
\prg_set_conditional:Npnn \zutil_cs_if_defined:c #1 { p, T, F, TF }
{
\if_cs_exist:w #1 \cs_end:
\prg_return_true:
Expand Down

0 comments on commit 9372926

Please sign in to comment.