diff options
Diffstat (limited to 'macros/latex-dev/required/l3kernel/l3keys.dtx')
-rw-r--r-- | macros/latex-dev/required/l3kernel/l3keys.dtx | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/macros/latex-dev/required/l3kernel/l3keys.dtx b/macros/latex-dev/required/l3kernel/l3keys.dtx index 13772d1781..0a808ac1b8 100644 --- a/macros/latex-dev/required/l3kernel/l3keys.dtx +++ b/macros/latex-dev/required/l3kernel/l3keys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2024-05-27} +% \date{Released 2024-10-09} % % \maketitle % @@ -649,15 +649,13 @@ % { key } % Name of choice key % { choice-a , choice-b , choice-c } % Valid choices % { \exp_not:n {#1} } % Invalid choice given -% % -% % % } % \end{verbatim} % % Multiple choices are created in a very similar manner to mutually-exclusive % choices, using the properties \texttt{.multichoice:} and % \texttt{.multichoices:nn}. As with mutually exclusive choices, multiple -% choices are define as sub-keys. Thus both +% choices are defined as sub-keys. Thus both % \begin{verbatim} % \keys_define:nn { mymodule } % { @@ -1926,19 +1924,21 @@ % \end{macro} % % \begin{macro}{\@@_define_code:n} +% \begin{macro}[EXP]{\@@_define_code:nnn} % \begin{macro}[EXP]{\@@_define_code:w} % Two possible cases. If there is a value for the key, then just use % the function. If not, then a check to make sure there is no need for % a value with the property. If there should be one then complain, -% otherwise execute it. There is no need to check for a |:| as if it -% was missing the earlier tests would have failed. +% otherwise execute it. For a \LaTeXe{} property like |.code| which +% doesn't contain a |:|, treat it as having arity 1 and pass the +% (empty) value to it. % \begin{macrocode} \cs_new_protected:Npn \@@_define_code:n #1 { \bool_if:NTF \l_@@_no_value_bool { - \exp_after:wN \@@_define_code:w - \l_@@_property_str \s_@@_stop + \@@_define_code:nnn + { \use:c { \c_@@_props_root_str \l_@@_property_str } {#1} } { \use:c { \c_@@_props_root_str \l_@@_property_str } } { \msg_error:nnee { keys } { property-requires-value } @@ -1947,12 +1947,31 @@ } { \use:c { \c_@@_props_root_str \l_@@_property_str } {#1} } } -\exp_last_unbraced:NNNNo - \cs_new:Npn \@@_define_code:w #1 \c_colon_str #2 \s_@@_stop - { \tl_if_empty:nTF {#2} } +\cs_new:Npe \@@_define_code:nnn + { + \exp_not:N \exp_after:wN \exp_not:N \@@_define_code:w + \exp_not:N \l_@@_property_str + \c_colon_str \c_colon_str + \exp_not:N \s_@@_stop + } +\use:e + { + \cs_new:Npn \exp_not:N \@@_define_code:w + #1 \c_colon_str #2 \c_colon_str #3 \exp_not:N \s_@@_stop + } + { + \tl_if_empty:nTF {#3} + { \use_i:nnn } + { + \tl_if_empty:nTF {#2} + { \use_ii:nnn } + { \use_iii:nnn } + } + } % \end{macrocode} % \end{macro} % \end{macro} +% \end{macro} % % \subsection{Turning properties into actions} % |