[latex3-commits] [git/LaTeX3-latex3-latex3] gh931-errors-v2: Correct expandable errors throughout the LaTeX3 repository (see #931) (0b73e5edc)
Bruno Le Floch
blflatex at gmail.com
Sun Aug 15 10:41:54 CEST 2021
Repository : https://github.com/latex3/latex3
On branch : gh931-errors-v2
Link : https://github.com/latex3/latex3/commit/0b73e5edc985bbce1d3de891add2473e9b1f0a63
>---------------------------------------------------------------
commit 0b73e5edc985bbce1d3de891add2473e9b1f0a63
Author: Bruno Le Floch <blflatex at gmail.com>
Date: Sun Aug 15 10:41:54 2021 +0200
Correct expandable errors throughout the LaTeX3 repository (see #931)
>---------------------------------------------------------------
0b73e5edc985bbce1d3de891add2473e9b1f0a63
l3experimental/l3str/testfiles/m3str-format001.tlg | 120 ++++++++++-----------
l3packages/xfp/testfiles/xfp001.tlg | 30 +++---
...symbolic001.tlg => m3fp-symbolic001.luatex.tlg} | 68 ++++++------
l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg | 68 ++++++------
l3trial/l3kernel-extras/l3kernel-extras.dtx | 9 +-
.../testfiles/m3kernel-extras007.luatex.tlg | 6 +-
.../testfiles/m3kernel-extras007.lvt | 6 +-
.../testfiles/m3kernel-extras007.tlg | 32 +++---
8 files changed, 162 insertions(+), 177 deletions(-)
diff --git a/l3experimental/l3str/testfiles/m3str-format001.tlg b/l3experimental/l3str/testfiles/m3str-format001.tlg
index 83c45a57f..ffafaed55 100644
--- a/l3experimental/l3str/testfiles/m3str-format001.tlg
+++ b/l3experimental/l3str/testfiles/m3str-format001.tlg
@@ -38,78 +38,70 @@ TEST 2: Formatting token list (empty and spaces)
============================================================
TEST 3: Invalid formattings for token lists
============================================================
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid alignment '=' for type 'tl'.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid alignment '=' for type 'tl'.
l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid sign '+' for type 'tl'.
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid sign '+' for type 'tl'.
l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid sign ' ' for type 'tl'.
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid sign ' ' for type 'tl'.
l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid sign '-' for type 'tl'.
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid sign '-' for type 'tl'.
l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid style '-' for type 'tl'.
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid style '-' for type 'tl'.
l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid style '.' for type 'tl'.
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid style '.' for type 'tl'.
l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid sign '+' for type 'tl'.
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid sign '+' for type 'tl'.
l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid style 't' for type 'tl'.
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid style 't' for type 'tl'.
l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
|abcdef|
|abcdef|
|abcdef|
diff --git a/l3packages/xfp/testfiles/xfp001.tlg b/l3packages/xfp/testfiles/xfp001.tlg
index dec501de5..1d1798b4d 100644
--- a/l3packages/xfp/testfiles/xfp001.tlg
+++ b/l3packages/xfp/testfiles/xfp001.tlg
@@ -9,24 +9,22 @@ TEST 1: fpeval
============================================================
|3.25476989|
|0.0000000000000002384626433832795|
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Unknown fp word foobar.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Unknown fp word foobar.
l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid operation fp_to_decimal(nan)
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid operation fp_to_decimal(nan)
l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
|0|
============================================================
============================================================
diff --git a/l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg b/l3trial/l3fp-extras/testfiles/m3fp-symbolic001.luatex.tlg
similarity index 75%
copy from l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg
copy to l3trial/l3fp-extras/testfiles/m3fp-symbolic001.luatex.tlg
index a2f89db6d..9d75becc4 100644
--- a/l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg
+++ b/l3trial/l3fp-extras/testfiles/m3fp-symbolic001.luatex.tlg
@@ -16,42 +16,38 @@ Defining \__fp_parse_word_C:N on line ...
============================================================
TEST 2: Conversions
============================================================
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid operation fp_to_decimal((A)+((B)^(2)))
-l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid operation fp_to_dim((A)+((B)^(2)))
-l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid operation fp_to_int((A)+((B)^(2)))
-l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid operation fp_to_scientific((A)+((B)^(2)))
-l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid operation fp_to_decimal((A)+((B)^(2)))
+l. ... }
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid operation fp_to_dim((A)+((B)^(2)))
+l. ... }
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid operation fp_to_int((A)+((B)^(2)))
+l. ... }
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid operation fp_to_scientific((A)+((B)^(2)))
+l. ... }
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
0
0pt
0
diff --git a/l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg b/l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg
index a2f89db6d..20a56563f 100644
--- a/l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg
+++ b/l3trial/l3fp-extras/testfiles/m3fp-symbolic001.tlg
@@ -16,42 +16,38 @@ Defining \__fp_parse_word_C:N on line ...
============================================================
TEST 2: Conversions
============================================================
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid operation fp_to_decimal((A)+((B)^(2)))
-l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid operation fp_to_dim((A)+((B)^(2)))
-l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid operation fp_to_int((A)+((B)^(2)))
-l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- Invalid operation fp_to_scientific((A)+((B)^(2)))
-l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid operation fp_to_decimal((A)+((B)^(2)))
+l. ... }
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid operation fp_to_dim((A)+((B)^(2)))
+l. ... }
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid operation fp_to_int((A)+((B)^(2)))
+l. ... }
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! LaTeX3 Error: Invalid operation fp_to_scientific((A)+((B)...
+l. ... }
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
0
0pt
0
diff --git a/l3trial/l3kernel-extras/l3kernel-extras.dtx b/l3trial/l3kernel-extras/l3kernel-extras.dtx
index 6d31f3503..6be6c3bfd 100644
--- a/l3trial/l3kernel-extras/l3kernel-extras.dtx
+++ b/l3trial/l3kernel-extras/l3kernel-extras.dtx
@@ -582,8 +582,7 @@
%
% \subsection{Expandable warnings}
%
-% We already know how to get expandable errors (see
-% \cs{__msg_expandable_error:n}). It turns out that \eTeX{}'s
+% We already know how to get expandable errors. It turns out that \eTeX{}'s
% \cs{tracingnesting} can be abused to produce custom warnings
% expandably.
%
@@ -716,7 +715,7 @@
% \begin{macrocode}
\sys_if_engine_luatex:T
{
- \cs_gset:Npx \__msg_expandable_error:n #1
+ \cs_gset:Npx \__msg_expandable_error:nn #1#2
{
\exp_not:N \tex_directlua:D
\exp_not:N \use:n
@@ -725,13 +724,13 @@
tex.error
( "
\exp_not:N \tex_luaescapestring:D
- { \exp_not:N \tl_to_str:n { LaTeX3~error:~#1} }
+ { \exp_not:N \tl_to_str:n { #2:~#1} }
" )
\prg_replicate:nn { 50 } { ~ }
}
}
}
- \cs_undefine:N \__msg_expandable_error:w
+ % \cs_undefine:c { ??? }
}
% \end{macrocode}
%
diff --git a/l3trial/l3kernel-extras/testfiles/m3kernel-extras007.luatex.tlg b/l3trial/l3kernel-extras/testfiles/m3kernel-extras007.luatex.tlg
index 810bbcb60..2df15e43e 100644
--- a/l3trial/l3kernel-extras/testfiles/m3kernel-extras007.luatex.tlg
+++ b/l3trial/l3kernel-extras/testfiles/m3kernel-extras007.luatex.tlg
@@ -1,15 +1,17 @@
This is a generated file for the LaTeX (2e + expl3) validation system.
Don't change this file in any respect.
Author: Bruno Le Floch
+Defining message test/a on line ...
+Defining message test/b on line ...
============================================================
TEST 1: expandable warnings and errors
============================================================
l. ...LaTeX3 warning: a
l. ...LaTeX3 warning: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-! LaTeX3 error: a.
+! Package test Error: a.
<argument> ... }
l. ... }
-! LaTeX3 error: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.
+! Package test Error: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.
<argument> ... }
l. ... }
============================================================
diff --git a/l3trial/l3kernel-extras/testfiles/m3kernel-extras007.lvt b/l3trial/l3kernel-extras/testfiles/m3kernel-extras007.lvt
index e6b9c146a..cfdcdc155 100644
--- a/l3trial/l3kernel-extras/testfiles/m3kernel-extras007.lvt
+++ b/l3trial/l3kernel-extras/testfiles/m3kernel-extras007.lvt
@@ -19,13 +19,15 @@
\START
\AUTHOR{Bruno Le Floch}
\ExplSyntaxOn
+\msg_new:nnn { test } { a } { a }
+\msg_new:nnn { test } { b } { aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa }
\TESTEXP { expandable~warnings~and~errors }
{
\__msg_expandable_warning:n { a }
\__msg_expandable_warning:n { aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa }
- \__msg_expandable_error:n { a }
- \__msg_expandable_error:n { aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa }
+ \msg_expandable_error:nn { test } { a }
+ \msg_expandable_error:nn { test } { b }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/l3trial/l3kernel-extras/testfiles/m3kernel-extras007.tlg b/l3trial/l3kernel-extras/testfiles/m3kernel-extras007.tlg
index e769658aa..0105551e6 100644
--- a/l3trial/l3kernel-extras/testfiles/m3kernel-extras007.tlg
+++ b/l3trial/l3kernel-extras/testfiles/m3kernel-extras007.tlg
@@ -1,6 +1,8 @@
This is a generated file for the LaTeX (2e + expl3) validation system.
Don't change this file in any respect.
Author: Bruno Le Floch
+Defining message test/a on line ...
+Defining message test/b on line ...
============================================================
TEST 1: expandable warnings and errors
============================================================
@@ -10,22 +12,20 @@ l. ... }
Warning: end of file when \if is incomplete
l. ......g: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
l. ... }
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- a
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! Package test Error: a
l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error:
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???
+ ! Package test Error: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
l. ... }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
============================================================
More information about the latex3-commits
mailing list.