diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3keys.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3keys.dtx | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index 511d1fd9b7a..bf34793cd57 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-05-28} +% \date{Released 2019-07-01} % % \maketitle % @@ -125,8 +125,8 @@ % \cs{keys_define:nn} \Arg{module} \Arg{keyval list} % \end{syntax} % Parses the \meta{keyval list} and defines the keys listed there for -% \meta{module}. The \meta{module} name should be a text value, but -% there are no restrictions on the nature of the text. In practice the +% \meta{module}. The \meta{module} name is treated as a string. +% In practice the % \meta{module} should be chosen to be unique to the module in question % (unless deliberately adding keys to an existing module). % @@ -1346,7 +1346,8 @@ { \@@_property_find:n {#1} \cs_if_exist:cTF { \c_@@_props_root_tl \l_@@_property_tl } - { \@@_define_code:n {#2} } + { \@@_define_code:n {#2} + } { \tl_if_empty:NF \l_@@_property_tl { @@ -1386,7 +1387,7 @@ { \tl_if_empty:NF \l_@@_module_tl { \l_@@_module_tl / } - #1 + \tl_trim_spaces:n {#1} } \tl_set:Nn \l_@@_property_tl { . #2 } } @@ -1436,7 +1437,7 @@ { \use:c { \c_@@_props_root_tl \l_@@_property_tl } {#1} } } \exp_last_unbraced:NNNNo - \cs_new:Npn \__keys_define_code:w #1 \c_colon_str #2 \q_stop + \cs_new:Npn \@@_define_code:w #1 \c_colon_str #2 \q_stop { \tl_if_empty:nTF {#2} } % \end{macrocode} % \end{macro} @@ -2680,12 +2681,41 @@ % \end{macro} % % \begin{macro}[EXP]{\@@_trim_spaces:n} -% Used in a few places so worth handling as a dedicated function. +% \begin{macro}[EXP] +% { +% \@@_trim_spaces_auxi:w , +% \@@_trim_spaces_auxii:w , +% \@@_trim_spaces_auxiii:w +% } +% Space stripping has to allow for the fact that the key here might have +% several parts, and spaces need to be stripped from each part. % \begin{macrocode} \cs_new:Npn \@@_trim_spaces:n #1 - { \tl_trim_spaces:o { \tl_to_str:n {#1} } } + { + \exp_after:wN \@@_trim_spaces_auxi:w \tl_to_str:n {#1} + / \q_nil \q_stop + + } +\cs_new:Npn \@@_trim_spaces_auxi:w #1 / #2 \q_stop + { + \quark_if_nil:nTF {#2} + { \tl_trim_spaces:n {#1} } + { \@@_trim_spaces_auxii:w #1 / #2 } + } +\cs_new:Npn \@@_trim_spaces_auxii:w #1 / #2 / \q_nil + { + \tl_trim_spaces:n {#1} + \@@_trim_spaces_auxiii:w #2 / \q_recursion_tail / \q_recursion_stop + } +\cs_set:Npn \@@_trim_spaces_auxiii:w #1 / + { + \quark_if_recursion_tail_stop:n {#1} + \tl_trim_spaces:n { / #1 } + \@@_trim_spaces_auxiii:w + } % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}[EXP,pTF]{\keys_if_exist:nn} % A utility for others to see if a key exists. |