diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3keys.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3keys.dtx | 76 |
1 files changed, 41 insertions, 35 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index da03797c65d..7195061bfcc 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018-08-23} +% \date{Released 2018-09-24} % % \maketitle % @@ -238,9 +238,7 @@ % \end{syntax} % Stores the \meta{code} for execution when \meta{key} is used. % The \meta{code} can include one parameter (|#1|), which will be the -% \meta{value} given for the \meta{key}. The \texttt{x}-type variant -% expands \meta{code} at the point where the \meta{key} is -% created. +% \meta{value} given for the \meta{key}. % \end{function} % % \begin{function}[updated = 2013-07-09] @@ -2300,7 +2298,7 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_execute:, \@@_execute_unknown:} +% \begin{macro}{\@@_execute:, \@@_execute_inherit:, \@@_execute_unknown:} % \begin{macro}[EXP]{\@@_execute:nn} % \begin{macro}{\@@_store_unused:} % Actually executing a key is done in two parts. First, look for the @@ -2317,42 +2315,50 @@ \cs:w \c_@@_code_root_tl \l_keys_path_tl \exp_after:wN \cs_end: \exp_after:wN { \l_keys_value_tl } } - { \@@_execute_unknown: } - } -\cs_new_protected:Npn \@@_execute_unknown: - { - \bool_if:NTF \l_@@_only_known_bool - { \@@_store_unused: } { - \cs_if_exist:cTF - { \c_@@_inherit_root_tl \@@_parent:o \l_keys_path_tl } + \bool_if:NTF \l_@@_only_known_bool + { \@@_store_unused: } { - \clist_map_inline:cn + \cs_if_exist:cTF { \c_@@_inherit_root_tl \@@_parent:o \l_keys_path_tl } - { - \cs_if_exist:cT - { \c_@@_code_root_tl ##1 / \l_keys_key_tl } - { - \cs:w \c_@@_code_root_tl ##1 / \l_keys_key_tl - \exp_after:wN \cs_end: \exp_after:wN - { \l_keys_value_tl } - \clist_map_break: - } - } + { \@@_execute_inherit: } + { \@@_execute_unknown: } } + } + } +% \end{macrocode} +% To deal with the case where there is no hit, we leave +% \cs{@@_execute_unknown:} in the input stream and clean it up using the +% break function: that avoids needing a boolean. +% \begin{macrocode} +\cs_new_protected:Npn \@@_execute_inherit: + { + \clist_map_inline:cn + { \c_@@_inherit_root_tl \@@_parent:o \l_keys_path_tl } + { + \cs_if_exist:cT + { \c_@@_code_root_tl ##1 / \l_keys_key_tl } { - \cs_if_exist:cTF - { \c_@@_code_root_tl \l_@@_module_tl / unknown } - { - \cs:w \c_@@_code_root_tl \l_@@_module_tl / unknown - \exp_after:wN \cs_end: \exp_after:wN { \l_keys_value_tl } - } - { - \__kernel_msg_error:nnxx { kernel } { key-unknown } - { \l_keys_path_tl } { \l_@@_module_tl } - } + \cs:w \c_@@_code_root_tl ##1 / \l_keys_key_tl + \exp_after:wN \cs_end: \exp_after:wN + { \l_keys_value_tl } + \clist_map_break:n { \use_none:n } } - } + } + \@@_execute_unknown: + } +\cs_new_protected:Npn \@@_execute_unknown: + { + \cs_if_exist:cTF + { \c_@@_code_root_tl \l_@@_module_tl / unknown } + { + \cs:w \c_@@_code_root_tl \l_@@_module_tl / unknown + \exp_after:wN \cs_end: \exp_after:wN { \l_keys_value_tl } + } + { + \__kernel_msg_error:nnxx { kernel } { key-unknown } + { \l_keys_path_tl } { \l_@@_module_tl } + } } \cs_new:Npn \@@_execute:nn #1#2 { |