[latex3-commits] [l3svn] 03/03: Reduce use of nopar in l3expan
noreply at latex-project.org
noreply at latex-project.org
Tue Jun 14 08:16:12 CEST 2016
This is an automated email from the git hooks/post-receive script.
joseph pushed a commit to branch master
in repository l3svn.
commit 7e16e00a7f07ffc265ceef6ccf4991a2686d21cc
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue Jun 14 07:15:33 2016 +0100
Reduce use of nopar in l3expan
Note setting of \l__exp_internal_tl uses \cs_set_nopar:Npx
not \tl_set:Nx.
---
l3kernel/l3expan.dtx | 98 ++++++++++++++++++-------------------
l3kernel/testfiles/m3expan001.tlg | 28 +++++------
l3kernel/testfiles/m3expan002.tlg | 20 ++++----
3 files changed, 73 insertions(+), 73 deletions(-)
diff --git a/l3kernel/l3expan.dtx b/l3kernel/l3expan.dtx
index 398efab..b2c9c10 100644
--- a/l3kernel/l3expan.dtx
+++ b/l3kernel/l3expan.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3expan.dtx Copyright (C) 1990-2015 The LaTeX3 project
+%% File: l3expan.dtx Copyright (C) 1990-2016 The LaTeX3 project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -105,10 +105,10 @@
% how the variants are defined. They just expand into the appropriate
% |\exp_| function followed by the desired base function, \emph{e.g.}
% \begin{quote}
-% |\cs_new_nopar:Npn \seq_gpush:No { \exp_args:NNo \seq_gpush:Nn }|
+% |\cs_new:Npn \seq_gpush:No { \exp_args:NNo \seq_gpush:Nn }|
% \end{quote}
% Providing variants in this way in style files is uncritical as the
-% \cs{cs_new_nopar:Npn} function will silently accept definitions whenever the
+% \cs{cs_new:Npn} function will silently accept definitions whenever the
% new definition is identical to an already given one. Therefore adding
% such definition to later releases of the kernel will not make such
% style files obsolete.
@@ -755,7 +755,7 @@
%
% \begin{function}{\::n, \::N, \::p, \::c, \::o, \::f, \::x, \::v, \::V, \:::}
% \begin{syntax}
-% |\cs_set_nopar:Npn \exp_args:Ncof { \::c \::o \::f \::: }|
+% |\cs_set:Npn \exp_args:Ncof { \::c \::o \::f \::: }|
% \end{syntax}
% Internal forms for the base expansion types. These names do \emph{not}
% conform to the general \LaTeX3 approach as this makes them more readily
@@ -789,7 +789,7 @@
% In this section a general mechanism for defining functions to handle
% argument handling is defined. These general expansion functions are
% expandable unless |x| is used. (Any version of |x| is going to have
-% to use one of the \LaTeX3 names for \cs{cs_set_nopar:Npx} at some
+% to use one of the \LaTeX3 names for \cs{cs_set:Npx} at some
% point, and so is never going to be expandable.)
%
% The definition of expansion functions with this technique happens
@@ -1180,7 +1180,7 @@
%
% \begin{macro}{\exp_args:Nx}
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \exp_args:Nx { \::x \::: }
+\cs_new_protected:Npn \exp_args:Nx { \::x \::: }
% \end{macrocode}
% \end{macro}
%
@@ -1198,21 +1198,21 @@
% Here are the actual function definitions, using the helper functions
% above.
% \begin{macrocode}
-\cs_new_nopar:Npn \exp_args:Nnc { \::n \::c \::: }
-\cs_new_nopar:Npn \exp_args:Nfo { \::f \::o \::: }
-\cs_new_nopar:Npn \exp_args:Nff { \::f \::f \::: }
-\cs_new_nopar:Npn \exp_args:Nnf { \::n \::f \::: }
-\cs_new_nopar:Npn \exp_args:Nno { \::n \::o \::: }
-\cs_new_nopar:Npn \exp_args:NnV { \::n \::V \::: }
-\cs_new_nopar:Npn \exp_args:Noo { \::o \::o \::: }
-\cs_new_nopar:Npn \exp_args:Nof { \::o \::f \::: }
-\cs_new_nopar:Npn \exp_args:Noc { \::o \::c \::: }
-\cs_new_protected_nopar:Npn \exp_args:NNx { \::N \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Ncx { \::c \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nnx { \::n \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nox { \::o \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nxo { \::x \::o \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nxx { \::x \::x \::: }
+\cs_new:Npn \exp_args:Nnc { \::n \::c \::: }
+\cs_new:Npn \exp_args:Nfo { \::f \::o \::: }
+\cs_new:Npn \exp_args:Nff { \::f \::f \::: }
+\cs_new:Npn \exp_args:Nnf { \::n \::f \::: }
+\cs_new:Npn \exp_args:Nno { \::n \::o \::: }
+\cs_new:Npn \exp_args:NnV { \::n \::V \::: }
+\cs_new:Npn \exp_args:Noo { \::o \::o \::: }
+\cs_new:Npn \exp_args:Nof { \::o \::f \::: }
+\cs_new:Npn \exp_args:Noc { \::o \::c \::: }
+\cs_new_protected:Npn \exp_args:NNx { \::N \::x \::: }
+\cs_new_protected:Npn \exp_args:Ncx { \::c \::x \::: }
+\cs_new_protected:Npn \exp_args:Nnx { \::n \::x \::: }
+\cs_new_protected:Npn \exp_args:Nox { \::o \::x \::: }
+\cs_new_protected:Npn \exp_args:Nxo { \::x \::o \::: }
+\cs_new_protected:Npn \exp_args:Nxx { \::x \::x \::: }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1229,19 +1229,19 @@
% \exp_args:Nccx, \exp_args:Ncnx, \exp_args:Noox,
% }
% \begin{macrocode}
-\cs_new_nopar:Npn \exp_args:NNno { \::N \::n \::o \::: }
-\cs_new_nopar:Npn \exp_args:NNoo { \::N \::o \::o \::: }
-\cs_new_nopar:Npn \exp_args:Nnnc { \::n \::n \::c \::: }
-\cs_new_nopar:Npn \exp_args:Nnno { \::n \::n \::o \::: }
-\cs_new_nopar:Npn \exp_args:Nooo { \::o \::o \::o \::: }
-\cs_new_protected_nopar:Npn \exp_args:NNNx { \::N \::N \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:NNnx { \::N \::n \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:NNox { \::N \::o \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nnnx { \::n \::n \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nnox { \::n \::o \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nccx { \::c \::c \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Ncnx { \::c \::n \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Noox { \::o \::o \::x \::: }
+\cs_new:Npn \exp_args:NNno { \::N \::n \::o \::: }
+\cs_new:Npn \exp_args:NNoo { \::N \::o \::o \::: }
+\cs_new:Npn \exp_args:Nnnc { \::n \::n \::c \::: }
+\cs_new:Npn \exp_args:Nnno { \::n \::n \::o \::: }
+\cs_new:Npn \exp_args:Nooo { \::o \::o \::o \::: }
+\cs_new_protected:Npn \exp_args:NNNx { \::N \::N \::x \::: }
+\cs_new_protected:Npn \exp_args:NNnx { \::N \::n \::x \::: }
+\cs_new_protected:Npn \exp_args:NNox { \::N \::o \::x \::: }
+\cs_new_protected:Npn \exp_args:Nnnx { \::n \::n \::x \::: }
+\cs_new_protected:Npn \exp_args:Nnox { \::n \::o \::x \::: }
+\cs_new_protected:Npn \exp_args:Nccx { \::c \::c \::x \::: }
+\cs_new_protected:Npn \exp_args:Ncnx { \::c \::n \::x \::: }
+\cs_new_protected:Npn \exp_args:Noox { \::o \::o \::x \::: }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1338,11 +1338,11 @@
}
\cs_new:Npn \exp_last_unbraced:NNNo #1#2#3#4
{ \exp_after:wN #1 \exp_after:wN #2 \exp_after:wN #3 #4 }
-\cs_new_nopar:Npn \exp_last_unbraced:Nno { \::n \::o_unbraced \::: }
-\cs_new_nopar:Npn \exp_last_unbraced:Noo { \::o \::o_unbraced \::: }
-\cs_new_nopar:Npn \exp_last_unbraced:Nfo { \::f \::o_unbraced \::: }
-\cs_new_nopar:Npn \exp_last_unbraced:NnNo { \::n \::N \::o_unbraced \::: }
-\cs_new_protected_nopar:Npn \exp_last_unbraced:Nx { \::x_unbraced \::: }
+\cs_new:Npn \exp_last_unbraced:Nno { \::n \::o_unbraced \::: }
+\cs_new:Npn \exp_last_unbraced:Noo { \::o \::o_unbraced \::: }
+\cs_new:Npn \exp_last_unbraced:Nfo { \::f \::o_unbraced \::: }
+\cs_new:Npn \exp_last_unbraced:NnNo { \::n \::N \::o_unbraced \::: }
+\cs_new_protected:Npn \exp_last_unbraced:Nx { \::x_unbraced \::: }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1485,7 +1485,7 @@
% \end{arguments}
% After making sure that the base form exists, test whether it is
% protected or not and define \cs{@@_tmp:w} as either
-% \cs{cs_new_nopar:Npx} or \cs{cs_new_protected_nopar:Npx}, which is
+% \cs{cs_new:Npx} or \cs{cs_new_protected:Npx}, which is
% then used to define all the variants (except those involving
% \texttt{x}-expansion, always protected). Split up the original base
% function only once, to grab its name and signature. Then we wish to
@@ -1526,21 +1526,21 @@
% |\bot|, |\splittop|, or |\splitbot|, with |\| replaced by the
% appropriate escape character. If |pr| appears in the part before
% |ma|, the first \cs{q_mark} is taken as an argument of the |wwNw|
-% auxiliary, and |#3| is \cs{cs_new_protected_nopar:Npx}, otherwise it
-% is \cs{cs_new_nopar:Npx}.
+% auxiliary, and |#3| is \cs{cs_new_protected:Npx}, otherwise it
+% is \cs{cs_new:Npx}.
% \begin{macrocode}
\cs_new_protected:Npx \@@_generate_variant:N #1
{
\exp_not:N \exp_after:wN \exp_not:N \if_meaning:w
\exp_not:N \exp_not:N #1 #1
- \cs_set_eq:NN \exp_not:N \@@_tmp:w \cs_new_protected_nopar:Npx
+ \cs_set_eq:NN \exp_not:N \@@_tmp:w \cs_new_protected:Npx
\exp_not:N \else:
\exp_not:N \exp_after:wN \exp_not:N \@@_generate_variant:ww
\exp_not:N \token_to_meaning:N #1 \tl_to_str:n { ma }
\exp_not:N \q_mark
- \exp_not:N \q_mark \cs_new_protected_nopar:Npx
+ \exp_not:N \q_mark \cs_new_protected:Npx
\tl_to_str:n { pr }
- \exp_not:N \q_mark \cs_new_nopar:Npx
+ \exp_not:N \q_mark \cs_new:Npx
\exp_not:N \q_stop
\exp_not:N \fi:
}
@@ -1800,7 +1800,7 @@
% If the variant form has already been defined, log its existence.
% Otherwise, make sure that the |\exp_args:N #3| form is defined, and
% if it contains |x|, change \cs{@@_tmp:w} locally to
-% \cs{cs_new_protected_nopar:Npx}. Then define the variant by
+% \cs{cs_new_protected:Npx}. Then define the variant by
% combining the |\exp_args:N #3| variant and the base function.
% \begin{macrocode}
\cs_new_protected:Npn \@@_generate_variant:wwNN
@@ -1839,11 +1839,11 @@
{
\exp_not:N \@@_generate_internal_variant:wwnNwnn
#1 \exp_not:N \q_mark
- { \cs_set_eq:NN \exp_not:N \@@_tmp:w \cs_new_protected_nopar:Npx }
- \cs_new_protected_nopar:cpx
+ { \cs_set_eq:NN \exp_not:N \@@_tmp:w \cs_new_protected:Npx }
+ \cs_new_protected:cpx
\token_to_str:N x \exp_not:N \q_mark
{ }
- \cs_new_nopar:cpx
+ \cs_new:cpx
\exp_not:N \q_stop
{ exp_args:N #1 }
{
diff --git a/l3kernel/testfiles/m3expan001.tlg b/l3kernel/testfiles/m3expan001.tlg
index b2d3b99..de109f1 100644
--- a/l3kernel/testfiles/m3expan001.tlg
+++ b/l3kernel/testfiles/m3expan001.tlg
@@ -23,15 +23,15 @@ Defining \bar:fvVonx on line ...
============================================================
TEST 1: protection
============================================================
-macro:->\exp_args:Noo \foo:nn
-macro:->\exp_args:NVV \foo:nn
-\protected macro:->\exp_args:Nxx \foo:nn
-macro:->\exp_args:Ncc \foo:nn
-\protected macro:->\exp_args:Nnx \foo:nn
-\protected macro:->\exp_args:Nfx \foo:nn
-\protected macro:->\exp_args:Nxf \foo:nn
-\protected macro:->\exp_args:NfvVonx \bar:nnnnnn
-\protected macro:->\::f \::v \::V \::o \::n \::x \:::
+\long macro:->\exp_args:Noo \foo:nn
+\long macro:->\exp_args:NVV \foo:nn
+\protected\long macro:->\exp_args:Nxx \foo:nn
+\long macro:->\exp_args:Ncc \foo:nn
+\protected\long macro:->\exp_args:Nnx \foo:nn
+\protected\long macro:->\exp_args:Nfx \foo:nn
+\protected\long macro:->\exp_args:Nxf \foo:nn
+\protected\long macro:->\exp_args:NfvVonx \bar:nnnnnn
+\protected\long macro:->\::f \::v \::V \::o \::n \::x \:::
============================================================
============================================================
TEST 2: expansion
@@ -123,7 +123,7 @@ l. ... }
| variants, or when building a parameter text from the number of arguments of
| the function.
|...............................................
-macro:->\exp_args:No \undefined:nn
+\long macro:->\exp_args:No \undefined:nn
undefined
undefined
undefined
@@ -133,21 +133,21 @@ TEST 4: Issue 101: protected variants for non-expandable primitives
============================================================
Defining \my_def:Npn on line ...
Defining \my_def:cpn on line ...
-\protected macro:->\exp_args:Nc \my_def:Npn
+\protected\long macro:->\exp_args:Nc \my_def:Npn
============================================================
============================================================
TEST 5: Issue 102: macros expanding to \protected
============================================================
Defining \foo:n on line ...
Defining \foo:o on line ...
-macro:->\exp_args:No \foo:n
+\long macro:->\exp_args:No \foo:n
============================================================
============================================================
TEST 6: Detect \protected with unusual \escapechar
============================================================
Defining /bar:n on line ...
Defining /bar:o on line ...
-/protected macro:->/exp_args:No /bar:n
+/protected/long macro:->/exp_args:No /bar:n
============================================================
============================================================
TEST 7: Issue 103: is the variant list a clist?
@@ -155,7 +155,7 @@ TEST 7: Issue 103: is the variant list a clist?
Defining \bar:f on line ...
Variant \bar:n already defined; not changing it on line ...
Defining \bar:x on line ...
-\protected macro:->\exp_args:Nx \bar:n
+\protected\long macro:->\exp_args:Nx \bar:n
============================================================
============================================================
TEST 8: What if the base function has no colon?
diff --git a/l3kernel/testfiles/m3expan002.tlg b/l3kernel/testfiles/m3expan002.tlg
index 96699c4..383e3a2 100644
--- a/l3kernel/testfiles/m3expan002.tlg
+++ b/l3kernel/testfiles/m3expan002.tlg
@@ -31,9 +31,9 @@ l. ... }
| (part after the colon) of '\foo:nnnNN'.
|...............................................
undefined
-\protected macro:->\exp_args:Noxvc \foo:nnnNN
-macro:->\exp_args:NonoNc \foo:nnnNN
-macro:->\exp_args:Nnonc \foo:nnnNN
+\protected\long macro:->\exp_args:Noxvc \foo:nnnNN
+\long macro:->\exp_args:NonoNc \foo:nnnNN
+\long macro:->\exp_args:Nnonc \foo:nnnNN
undefined
============================================================
============================================================
@@ -99,9 +99,9 @@ l. ... }
| signature starting with 'oNnTFF', but that is longer than the signature
| (part after the colon) of '\foo:oNnTF'.
|...............................................
-macro:->\exp_args:NnNo \foo:oNnTF
-\protected macro:->\exp_args:NnNx \foo:oNnTF
-macro:->\exp_args:Nnc \foo:oNnTF
+\long macro:->\exp_args:NnNo \foo:oNnTF
+\protected\long macro:->\exp_args:NnNx \foo:oNnTF
+\long macro:->\exp_args:Nnc \foo:oNnTF
undefined
undefined
undefined
@@ -111,14 +111,14 @@ TEST 3: Using p arguments
============================================================
Defining \exp_args:Ncpo on line ...
Defining \cs_new:cpo on line ...
-\protected macro:->\exp_args:Ncpo \cs_new:Npn
-macro:->\::c \::p \::o \:::
+\protected\long macro:->\exp_args:Ncpo \cs_new:Npn
+\long macro:->\::c \::p \::o \:::
Defining \foo_bar:nw on line ...
\long macro:#1#2\q_stop ->#1
Defining \exp_args:NNpox on line ...
Defining \prg_new_conditional:Npox on line ...
-\protected macro:->\exp_args:NNpox \prg_new_conditional:Npnn
-\protected macro:->\::N \::p \::o \::x \:::
+\protected\long macro:->\exp_args:NNpox \prg_new_conditional:Npnn
+\protected\long macro:->\::N \::p \::o \::x \:::
Defining \foo_bar:wF on line ...
undefined
\long macro:#1;->\prg_return_true: \exp_end: {}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the latex3-commits
mailing list