summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3prop.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-05-17 03:01:58 +0000
committerNorbert Preining <norbert@preining.info>2023-05-17 03:01:58 +0000
commit92ffb9032b85f818a8d3b469ad4d3889c2a44ba1 (patch)
tree54bc1ce009357117a376baa5ffa223f904acee4f /macros/latex/contrib/l3kernel/l3prop.dtx
parent95bdae3d8a40af1f2f82f786dc29d3761fe431f1 (diff)
CTAN sync 202305170301
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3prop.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3prop.dtx69
1 files changed, 17 insertions, 52 deletions
diff --git a/macros/latex/contrib/l3kernel/l3prop.dtx b/macros/latex/contrib/l3kernel/l3prop.dtx
index 297fcd877f..341b46bdff 100644
--- a/macros/latex/contrib/l3kernel/l3prop.dtx
+++ b/macros/latex/contrib/l3kernel/l3prop.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2023-05-11}
+% \date{Released 2023-05-15}
%
% \maketitle
%
@@ -1087,66 +1087,31 @@
% have to make sure that the behaviour is as good as possible. Using a space
% before the opening brace we get the correct brace stripping behaviour for
% most of the key--value parsers available in \LaTeX.
-% If \cs{tex_expanded:D} is available this function makes use of it, so there
-% are two different implementations here. They both start with
-% \cs{__kernel_exp_not:w} to start the expansion context to expand in two
-% steps. If the \meta{property list} is empty they just leave an empty set of
-% braces in the input stream for \cs{__kernel_exp_not:w}.
-% \begin{macrocode}
-\cs_if_exist:NTF \tex_expanded:D
- {
-% \end{macrocode}
-% The variant using \cs{tex_expanded:D} can just iterate over the
+% Iterate over the
% \meta{property list} and remove the leading comma afterwards. Only the value
% has to be protected in \cs{__kernel_exp_not:w} as the property name is
% always a string. After the loop the leading comma is removed by
% \cs{use_none:n} and afterwards \cs{__kernel_exp_not:w} eventually finds the
% opening brace of its argument.
% \begin{macrocode}
- \cs_new:Npn \prop_to_keyval:N #1
- {
- \__kernel_exp_not:w
- \prop_if_empty:NTF #1
- { {} }
- {
- \exp_after:wN \exp_after:wN \exp_after:wN
+\cs_new:Npn \prop_to_keyval:N #1
+ {
+ \__kernel_exp_not:w
+ \prop_if_empty:NTF #1
+ { {} }
+ {
+ \exp_after:wN \exp_after:wN \exp_after:wN
+ {
+ \tex_expanded:D
{
- \tex_expanded:D
- {
- \__kernel_exp_not:w { \use_none:n }
- \prop_map_function:NN #1 \@@_to_keyval:nn
- }
+ \__kernel_exp_not:w { \use_none:n }
+ \prop_map_function:NN #1 \@@_to_keyval:nn
}
- }
- }
- \cs_new:Npn \@@_to_keyval:nn #1#2
- { , ~ {#1} =~ { \__kernel_exp_not:w {#2} } }
- }
-% \end{macrocode}
-% The other variant will iterate over the \meta{property list} and has to
-% output the result in a group after the marker
-% \cs{@@_to_keyval_exp_after:wN}. As a result this is considerably slower than
-% the \cs{tex_expanded:D} using variant as it has to read the entire contents
-% of the \meta{property list} for each item. Since the marker is just
-% \cs{exp_after:wN} with another name, after the loop the leading comma is
-% gobbled by \cs{use_none:n}, leaving the result as the argument to
-% \cs{__kernel_exp_not:w}.
-% \begin{macrocode}
- {
- \cs_new:Npn \prop_to_keyval:N #1
- {
- \__kernel_exp_not:w
- \prop_if_empty:NTF #1
- { {} }
- {
- \prop_map_function:NN #1 \@@_to_keyval:nnw
- \@@_to_keyval_exp_after:wN { \use_none:n }
- }
- }
- \cs_new_eq:NN \@@_to_keyval_exp_after:wN \exp_after:wN
- \cs_new:Npn \@@_to_keyval:nnw #1#2#3 \@@_to_keyval_exp_after:wN #4
- { #3 \@@_to_keyval_exp_after:wN { #4 , ~ {#1} =~ {#2} } }
+ }
+ }
}
+\cs_new:Npn \@@_to_keyval:nn #1#2
+ { , ~ {#1} =~ { \__kernel_exp_not:w {#2} } }
% \end{macrocode}
% \end{macro}
% \end{macro}