diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3tl.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3tl.dtx | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index 5ffb9ffdf33..57bfe04f3d7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3tl.dtx 6037 2015-09-23 12:41:15Z joseph $ +\GetIdInfo$Id: l3tl.dtx 6121 2015-09-29 20:31:06Z bruno $ {L3 Token lists} %</driver|package> %<*driver> @@ -1833,14 +1833,16 @@ % If on the one hand it is found within the \meta{token list}, then % |##1| cannot contain the \meta{delimiter}~|#1| that we worked so % hard to obtain, thus \cs{@@_replace_wrap:w} gets~|##1| as its own -% argument~|##1|, and wraps it using \cs{exp_not:o} for consumption by +% argument~|##1|, and protects it against % the \texttt{x}-expanding assignment. It also finds \cs{exp_not:n} % as~|##2| and does nothing to it, thus letting through \cs{exp_not:n} -% \Arg{replacement} into the assignment. (Note that +% \Arg{replacement} into the assignment. Note that % \cs{@@_replace_next:w} and \cs{@@_replace_wrap:w} are always called -% followed by \cs{prg_do_nothing:} to avoid losing braces when -% grabbing delimited arguments, hence the use of \cs{exp_not:o} rather -% than \cs{exp_not:n}.) Afterwards, \cs{@@_replace_next:w} is called +% followed by two empty brace groups. These are safe because no +% delimiter can match them. They prevent losing braces when grabbing +% delimited arguments, but require the use of \cs{exp_not:o} and +% \cs{use_none:nn}, rather than simply \cs{exp_not:n}. +% Afterwards, \cs{@@_replace_next:w} is called % to repeat the replacement, or \cs{@@_replace_wrap:w} if we only want % a single replacement. In this second case, |##1| is the % \meta{remaining tokens} in the \meta{token list} and |##2| is some @@ -1850,9 +1852,9 @@ % % If on the other hand the argument~|##1| of \cs{@@_replace_next:w} is % delimited by the trailing \meta{pattern}~|#5|, then |##1| is -% \enquote{\cs{prg_do_nothing:} \meta{token list} \meta{delimiter} +% \enquote{\{ \} \{ \} \meta{token list} \meta{delimiter} % \Arg{ending code}}, hence \cs{@@_replace_wrap:w} finds -% \enquote{\cs{prg_do_nothing:} \meta{token list}} as |##1| and the +% \enquote{\{ \} \{ \} \meta{token list}} as |##1| and the % \meta{ending code} as~|##2|. It leaves the \meta{token list} into % the assignment and unbraces the \meta{ending code} which removes % what remains (essentially the \meta{delimiter} and @@ -1861,25 +1863,27 @@ \cs_new_protected:Npn \@@_replace_auxii:nNNNnn #1#2#3#4#5#6 { \group_align_safe_begin: - \cs_set:Npn \@@_replace_wrap:w ##1 #1 ##2 { \exp_not:o {##1} ##2 } + \cs_set:Npn \@@_replace_wrap:w ##1 #1 ##2 + { \exp_not:o { \use_none:nn ##1 } ##2 } \cs_set:Npx \@@_replace_next:w ##1 #5 { \exp_not:N \@@_replace_wrap:w ##1 \exp_not:n { #1 } \exp_not:n { \exp_not:n {#6} } - \exp_not:n { #2 \prg_do_nothing: } + \exp_not:n { #2 { } { } } } #3 #4 { \exp_after:wN \@@_replace_next:w - \exp_after:wN \prg_do_nothing: #4 + \exp_after:wN { \exp_after:wN } + \exp_after:wN { \exp_after:wN } + #4 #1 { \if_false: { \fi: } \exp_after:wN \use_none:n \exp_after:wN { \if_false: } \fi: } #5 - \q_recursion_stop } \group_align_safe_end: } |