From 6d95b4a2c1bbdaea1a3802c822808f476ac5703b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 16 Sep 2011 22:35:41 +0000 Subject: l3kernel 2828 (15sep11) git-svn-id: svn://tug.org/texlive/trunk@23983 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/l3kernel/l3quark.dtx | 72 +++++++--------------- 1 file changed, 23 insertions(+), 49 deletions(-) (limited to 'Master/texmf-dist/source/latex/l3kernel/l3quark.dtx') diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx index 4f8a12c67d4..bf414270bb6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx @@ -9,7 +9,7 @@ %% %% http://www.latex-project.org/lppl.txt %% -%% This file is part of the "expl3 bundle" (The Work in LPPL) +%% This file is part of the "l3kernel bundle" (The Work in LPPL) %% and all files in that bundle must be distributed together. %% %% The released version of this bundle is available from CTAN. @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3names} -\GetIdInfo$Id: l3quark.dtx 2665 2011-08-25 22:15:27Z joseph $ +\GetIdInfo$Id: l3quark.dtx 2798 2011-09-10 15:42:13Z will $ {L3 Experimental quarks} % %<*driver> @@ -136,7 +136,7 @@ % % \begin{function}[EXP,pTF]{\quark_if_nil:n, \quark_if_nil:o, \quark_if_nil:V} % \begin{syntax} -% \cs{quark_if_nil_p:n} \Arg{token list} +% \cs{quark_if_nil_p:n} \Arg{token list} \\ % \cs{quark_if_nil:nTF} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} % Tests if the \meta{token list} contains only \cs{q_nil} (distinct @@ -146,18 +146,16 @@ % % \begin{function}[EXP,pTF]{\quark_if_no_value:N, \quark_if_no_value:c} % \begin{syntax} -% \cs{quark_if_no_value_p:N} \meta{token} -% \cs{quark_if_no_value:NTF} \meta{token} \Arg{true code} -% ~~\Arg{false code} +% \cs{quark_if_no_value_p:N} \meta{token} \\ +% \cs{quark_if_no_value:NTF} \meta{token} \Arg{true code} \Arg{false code} % \end{syntax} % Tests if the \meta{token} is equal to \cs{q_no_value}. % \end{function} % % \begin{function}[EXP,pTF]{\quark_if_no_value:n} % \begin{syntax} -% \cs{quark_if_no_value_p:n} \Arg{token list} -% \cs{quark_if_no_value:nTF} \Arg{token list} \Arg{true code} -% ~~\Arg{false code} +% \cs{quark_if_no_value_p:n} \Arg{token list} \\ +% \cs{quark_if_no_value:nTF} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} % Tests if the \meta{token list} contains only \cs{q_no_value} % (distinct from \meta{token list} being empty or containing @@ -193,12 +191,12 @@ % and \cs{q_recursion_stop} as the last two items. % \end{function} % -% \begin{function} +% \begin{function}[updated = 2011-09-06] % {\quark_if_recursion_tail_stop:n, \quark_if_recursion_tail_stop:o} % \begin{syntax} -% \cs{quark_if_recursion_tail_stop:n} \Arg{tokens} +% \cs{quark_if_recursion_tail_stop:n} \Arg{token list} % \end{syntax} -% Tests if \meta{tokens} consists of the single token +% Tests if the \meta{token list} contains only % \cs{q_recursion_tail}, and if so terminates the recursion this is % part of using \cs{use_none_delimit_by_q_recursion_stop:w}. The % recursion input must include the marker tokens \cs{q_recursion_tail} @@ -207,7 +205,7 @@ % % \begin{function}{\quark_if_recursion_tail_stop_do:Nn} % \begin{syntax} -% \cs{quark_if_recursion_tail_stop_do:nn} \Arg{token} \Arg{insertion} +% \cs{quark_if_recursion_tail_stop_do:Nn} \Arg{token} \Arg{insertion} % \end{syntax} % Tests if \meta{token} contains only the marker % \cs{q_recursion_tail}, and if so terminates the recursion this is @@ -218,12 +216,12 @@ % ended. % \end{function} % -% \begin{function} +% \begin{function}[updated = 2011-09-06] % {\quark_if_recursion_tail_stop_do:nn, \quark_if_recursion_tail_stop_do:on} % \begin{syntax} -% \cs{quark_if_recursion_tail_stop_do:nn} \Arg{tokens} \Arg{insertion} +% \cs{quark_if_recursion_tail_stop_do:nn} \Arg{token list} \Arg{insertion} % \end{syntax} -% Tests if \meta{tokens} consists of the single token +% Tests if the \meta{token list} contains only % \cs{q_recursion_tail}, and if so terminates the recursion this is % part of using \cs{use_none_delimit_by_q_recursion_stop:w}. The % recursion input must include the marker tokens \cs{q_recursion_tail} @@ -236,8 +234,7 @@ % % \begin{function}{\use_none_delimit_by_q_recursion_stop:w} % \begin{syntax} -% \cs{use_none_delimit_by_q_recursion_stop:w} -% ~~\meta{tokens} \cs{q_recursion_stop} +% \cs{use_none_delimit_by_q_recursion_stop:w} \meta{tokens} \cs{q_recursion_stop} % \end{syntax} % Used to prematurely terminate a recursion using \cs{q_recursion_stop} % as the end marker, removing any remaining \meta{tokens} from the @@ -325,14 +322,13 @@ \exp_after:wN \use_none_delimit_by_q_recursion_stop:w \fi: } -\cs_new:Npn \quark_if_recursion_tail_stop_do:Nn #1#2 +\cs_new:Npn \quark_if_recursion_tail_stop_do:Nn #1 { \if_meaning:w #1 \q_recursion_tail \exp_after:wN \use_i_delimit_by_q_recursion_stop:nw \else: \exp_after:wN \use_none:n \fi: - {#2} } % \end{macrocode} % \end{macro} @@ -345,47 +341,25 @@ % {\quark_if_recursion_tail_stop_do:nn,\quark_if_recursion_tail_stop_do:on} % \UnitTested % \begin{macro}[aux]{\quark_if_recursion_tail_aux:w} -% The same idea applies when testing multiple tokens, but here a little more -% care is needed. It is possible that |#1| might be something like -% |{{{a}}}| or |{ab\iffalse}\fi|, which will therefore need to be tested -% in a detokenized manner. The way that this is done is using -% \cs{if_catcode:w}, with the idea being that this test will be \texttt{true} -% provided the auxiliary function returns nothing at all. If the auxiliary -% returns anything, it will be detokenized and so the test will be both -% \texttt{false} and safe. +% The same idea applies when testing multiple tokens, but here we just +% compare the token list to \cs{q_recursion_tail} as a string. % \begin{macrocode} \cs_new:Npn \quark_if_recursion_tail_stop:n #1 { - \if_catcode:w - A - \etex_detokenize:D \exp_after:wN - { - \quark_if_recursion_tail_aux:w #1 \q_recursion_stop - \q_recursion_tail \q_recursion_stop \q_stop - } - A + \if_int_compare:w \pdftex_strcmp:D + { \exp_not:N \q_recursion_tail } { \exp_not:n {#1} } = \c_zero \exp_after:wN \use_none_delimit_by_q_recursion_stop:w \fi: } -\cs_new:Npn \quark_if_recursion_tail_stop_do:nn #1#2 +\cs_new:Npn \quark_if_recursion_tail_stop_do:nn #1 { - \if_catcode:w - A - \etex_detokenize:D \exp_after:wN - { - \quark_if_recursion_tail_aux:w #1 \q_recursion_stop - \q_recursion_tail \q_recursion_stop \q_stop - } - A + \if_int_compare:w \pdftex_strcmp:D + { \exp_not:N \q_recursion_tail } { \exp_not:n {#1} } = \c_zero \exp_after:wN \use_i_delimit_by_q_recursion_stop:nw \else: \exp_after:wN \use_none:n \fi: - {#2} } -\cs_new:Npn \quark_if_recursion_tail_aux:w - #1 \q_recursion_tail #2 \q_recursion_stop #3 \q_stop - { #1 #2 } \cs_generate_variant:Nn \quark_if_recursion_tail_stop:n { o } \cs_generate_variant:Nn \quark_if_recursion_tail_stop_do:nn { o } % \end{macrocode} -- cgit v1.2.3