summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3prop.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prop.dtx50
1 files changed, 49 insertions, 1 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
index d79073065dc..cd2f51c9988 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-25}
+% \date{Released 2019-09-05}
%
% \maketitle
%
@@ -353,6 +353,8 @@
% each iteration: the \meta{key} and associated \meta{value}.
% The order in which \meta{entries} are returned is not defined and
% should not be relied upon.
+% To pass further arguments to the \meta{function}, see
+% \cs{prop_map_tokens:Nn}.
% \end{function}
%
% \begin{function}[updated = 2013-01-08]
@@ -368,6 +370,24 @@
% should not be relied upon.
% \end{function}
%
+% \begin{function}[rEXP]
+% {\prop_map_tokens:Nn, \prop_map_tokens:cn}
+% \begin{syntax}
+% \cs{prop_map_tokens:Nn} \meta{property list} \Arg{code}
+% \end{syntax}
+% Analogue of \cs{prop_map_function:NN} which maps several tokens
+% instead of a single function. The \meta{code} receives each
+% key--value pair in the \meta{property list} as two trailing brace
+% groups. For instance,
+% \begin{verbatim}
+% \prop_map_tokens:Nn \l_my_prop { \str_if_eq:nnT { mykey } }
+% \end{verbatim}
+% expands to the value corresponding to \texttt{mykey}: for each
+% pair in |\l_my_prop| the function \cs{str_if_eq:nnT} receives
+% \texttt{mykey}, the \meta{key} and the \meta{value} as its three
+% arguments. For that specific task, \cs{prop_item:Nn} is faster.
+% \end{function}
+%
% \begin{function}[updated = 2012-06-29, rEXP]{\prop_map_break:}
% \begin{syntax}
% \cs{prop_map_break:}
@@ -1215,6 +1235,34 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[rEXP]{\prop_map_tokens:Nn, \prop_map_tokens:cn}
+% \begin{macro}{\@@_map_tokens:nwwn}
+% The mapping is very similar to \cs{prop_map_function:NN}. The
+% \cs{use_i:nn} removes the leading \cs{s_@@}. The odd construction
+% |\use:n {#1}| allows |#1| to contain any token without interfering
+% with \cs{prop_map_break:}. The loop stops when the argument
+% delimited by \cs{@@_pair:wn} is \cs{prg_break:} instead of being
+% empty.
+% \begin{macrocode}
+\cs_new:Npn \prop_map_tokens:Nn #1#2
+ {
+ \exp_last_unbraced:Nno
+ \use_i:nn { \@@_map_tokens:nwwn {#2} } #1
+ \prg_break: \@@_pair:wn \s_@@ { } \prg_break_point:
+ \prg_break_point:Nn \prop_map_break: { }
+ }
+\cs_new:Npn \@@_map_tokens:nwwn #1#2 \@@_pair:wn #3 \s_@@ #4
+ {
+ #2
+ \use:n {#1} {#3} {#4}
+ \@@_map_tokens:nwwn {#1}
+ }
+\cs_generate_variant:Nn \prop_map_tokens:Nn { c }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
% \begin{macro}[tested = m3prop003]{\prop_map_break:}
% \begin{macro}[tested = m3prop003]{\prop_map_break:n}
% The break statements are based on the general \cs{prg_map_break:Nn}.