summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2012-10-06 09:34:54 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2012-10-06 09:34:54 +0000
commit11eb9a3891b7dd3261bf06e2421e6ae87aba4153 (patch)
tree0a1ec8718e0c0ac641c4e7630e2278a438d9b11a /Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
parenta9a23194b1cababcf9c24e48937a726cb465813a (diff)
l3kernel update
git-svn-id: svn://tug.org/texlive/trunk@27898 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3keys.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3keys.dtx46
1 files changed, 27 insertions, 19 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
index dea8b1923a9..c24027b488a 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3keys.dtx 3991 2012-07-16 19:00:35Z joseph $
+\GetIdInfo$Id: l3keys.dtx 4248 2012-09-29 19:55:27Z joseph $
{L3 Experimental key-value interfaces}
%</driver|package>
%<*driver>
@@ -786,7 +786,7 @@
\tl_replace_all:Nnn \l_@@_sanitise_tl { , } { 9 }
\tl_clear:N \l_@@_parse_tl
\exp_after:wN \@@_parse_elt:w \exp_after:wN
- \q_no_value \l_@@_sanitise_tl 9 \q_nil 9
+ \q_nil \l_@@_sanitise_tl 9 \q_recursion_tail 9 \q_recursion_stop
\exp_after:wN \group_end:
\l_@@_parse_tl
}
@@ -795,22 +795,20 @@
% \end{macro}
%
% \begin{macro}{\@@_parse_elt:w}
-% Each item to be parsed will have \cs{q_no_value} added to the front.
+% Each item to be parsed will have \cs{q_nil} added to the front.
% Hence the blank test here can always be used to find a totally
% empty argument. If this is the case, the system loops round. If there
-% is something to parse, there is a check for the \cs{q_nil} marker
-% and if not a hand-off.
+% is something to parse, there is a check for the end of the input before
+% handing off.
% \begin{macrocode}
\cs_new_protected:Npn \@@_parse_elt:w #1 ,
{
\tl_if_blank:oTF { \use_none:n #1 }
- { \@@_parse_elt:w \q_no_value }
+ { \@@_parse_elt:w \q_nil }
{
- \quark_if_nil:oF { \use_ii:nn #1 }
- {
- \@@_split_key_value:w #1 = = \q_stop
- \@@_parse_elt:w \q_no_value
- }
+ \quark_if_recursion_tail_stop:o { \use_ii:nn #1 }
+ \@@_split_key_value:w #1 = = \q_stop
+ \@@_parse_elt:w \q_nil
}
}
% \end{macrocode}
@@ -829,7 +827,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_split_key_value:w #1 = #2 \q_stop
{
- \@@_split_key:w #1 \q_stop
+ \@@_split_key:n {#1}
\str_if_eq:nnTF {#2} { = }
{
\tl_put_right:Nx \l_@@_parse_tl
@@ -851,18 +849,28 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@@_split_key:w}
-% The aim here is to remove spaces and also exactly one set of braces.
-% There is also a quark to remove, hence the \cs{use_none:n} appearing before
-% application of \cs{tl_trim_spaces:n}.
+% \begin{macro}{\@@_split_key:n}
+% \begin{macro}[aux]{\@@_split_key:w}
+% There are two possible cases here. The first case is that |#1| is
+% surrounded by braces, in which case the |\use_none:nnn #1 \q_nil \q_nil|
+% will yield \cs{q_nil}. There, we can remove the leading \cs{q_nil}, the
+% braces and any spaces around the outside with \cs{use_ii:nnn}. On the
+% other hand, if there are no braces then the second branch removes the
+% leading \cs{q_nil} and any surrounding spaces. (This code does not have
+% to cover the case with no key, as that's already taken out above.)
% \begin{macrocode}
-\cs_new_protected:Npn \@@_split_key:w #1 \q_stop
+\cs_new_protected:Npn \@@_split_key:n #1
{
- \tl_set:Nx \l_@@_key_tl
- { \exp_after:wN \tl_trim_spaces:n \exp_after:wN { \use_none:n #1 } }
+ \str_if_eq_x:nnTF
+ { \exp_not:N \q_nil } { \exp_not:o { \use_none:nnn #1 \q_nil \q_nil } }
+ { \tl_set:Nx \l_@@_key_tl { \exp_not:o { \use_ii:nnn #1 \q_nil } } }
+ { \@@_split_key:w #1 \q_stop }
}
+\cs_new_protected:Npn \@@_split_key:w \q_nil #1 \q_stop
+ { \tl_set:Nx \l_@@_key_tl { \tl_trim_spaces:n {#1} } }
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@_split_value:w}
% Here the value has to be separated from the equals signs and the