[tex-k] Bug report for the 2029 TeX tune-up - Error-message is expected but the text of the error-message is incorrect
ud.usenetcorrespondence at web.de
ud.usenetcorrespondence at web.de
Sat Jun 19 13:45:58 CEST 2021
Bug report for the 2029 TeX tune-up
Subject: Error-message is expected but the text of the error-message is incorrect
Submitted by: Ulrich Diez (diez.ulrich at web.de / ud.usenetcorrespondence at web.de)
.tex-input-file FileA.tex contains:
Line 1
Line 2
Line 3
.tex-input-file test.tex contains:
\endinput\edef\foobar{\input FileA.tex }%
\bye
I am aware of the circumstance that with \input "inside" \edef
you expect an error-message in any case. That is not what this
bug-report is about.
Be aware that in test.tex \endinput is _before_ \edef !
Chapter 20: Definitions (also called macros) of the TeXbook says
about \endinput:
| - \endinput. The expansion is null. The next time TeX gets to the end
| of an \input line, it will stop reading from the file containing that line.
Compiling test.tex via tex test.tex yields the following console-output:
This is TeX, Version 3.14159265 (TeX Live 2020) (preloaded format=tex)
(./test.tex (./FileA.tex)
Runaway definition?
->Line 1
! File ended while scanning definition of \foobar.
<inserted text>
}
l.1 \endinput\edef\foobar{\input FileA.tex
}%
?
! Too many }'s.
l.1 \endinput\edef\foobar{\input FileA.tex }
%
?
)
No pages of output.
Transcript written on test.log.
Do you see the statement
->Line 1
! File ended while scanning definition of \foobar.
?
That statement is not correct in this subtle case.
In this subtle case the reason for the runaway-definition
is not that TeX encountered the _end_ of a file.
In this subtle case the reason for the runaway-definition
is that reading from fileA.tex was ceased due to the
pending \endinput after reading and processing the
first line of fileA.tex.
In this subtle case a correct statement would be something
like:
->Line 1
! Due to pending \endinput reading from file was ceased
! after reading its first line while scanning definition
! of \foobar.
Shorter and less informative:
->Line 1
! Processing the file ended while scanning definition of \foobar.
This doesn't say anything about the reason (reaching the end/
pending \endinput and end of file's first line) for ending the
processing of the file.
Rectifying this would probably be nice for people who play
with TeX-engines where eTeX-extensions with things like
\everyeof{\noexpand}\edef\foobar{\scantokens{..}}
are possible and who seem to struggle with misleading
statements coming from error-messages.
See, e.g.,
https://groups.google.com/g/comp.text.tex/c/tdE_mQrMoiE/m/7l9MWXl7AwAJ
Sincerely
Ulrich Diez
More information about the tex-k
mailing list.