# [tex-live] \scantokens and --file-line-error

Hans Hagen Outside pragma at wxs.nl
Tue Aug 24 00:59:38 CEST 2004

Olaf Weber wrote:

>Karl Berry writes:
>
>
>
>>Hi Olaf (I guess this one is for you),
>>The \scantokens etex construct and --file-line-error option apparently
>>interact in strange ways.
>>
>>
>
>Then let's remove \scantokens.
>
>
eh ... i've been using etex for years and use scantokens as well, so
that's no option

I'm not sure if i understand the implications of this thread -)

Anyhow, i think that it makes sense to keep the usage of scantokens into
acount. It's mostly used to (reprocess) text under a different catcode
regime, (reprocessing  using macros and token lists has been part of tex
from the beginning), such as:

\def\SomeTextAndMacros{....}

\bgroup
... set some catcoded
\scantokens\expandafter{\SomeTextAndMacros}
\egroup

Apart from the content/role of \everyeof one cannot expect line ends to
be part of the game unless they are already recognizable part of the
data fed into scantokens.

Since scantokens is a kind of pseudo file,  maybe each scantokens
invocation register itself as a file on the stack then (like
scantokens-1, scantokens-2 etc)    so that the message looks like

/ssc.tex:2: scantokens-1:1: scantokens-2:1: Undefined control sequence.
l.1 \foo

l.1 \scantokens {\foo }

l.2 \scantokens{\scantokens{\foo}}

?

anyhow, those who use scantokens must be prepared to twisted thinking
anyway so how big is this message problem really?

Hans

-----------------------------------------------------------------