On Mon, Jan 27, 2020 at 2:53 PM Phelype Oleinik <[email protected]> wrote:

> Hello all,
>
> When using \input{...} inside an \edef the first token
> in the file disappears:
>
>     \directlua{\unexpanded{%
>       out = io.open('testfile.tex','w')
>       out:write('hello\\noexpand')
>       io.close(out)}}
>     \edef\tmpa{\input{testfile.tex}}\show\tmpa
>     % > \tmpa=macro:
>     % ello
>     \bye
>
> For some reason, it gets worse if the file starts
> with \noexpand\something:
>
>     \directlua{\unexpanded{%
>       out = io.open('testfile.tex','w')
>       out:write('\\noexpand\\hello\\noexpand')
>       io.close(out)}}
>     \edef\tmpa{\input{testfile.tex}}\show\tmpa
>     % > \tmpa=macro:
>     % <gibberish>
>     \bye
>
> If I use \edef\tmpa{\input testfile.tex } instead, both
> examples work as expected.
>
>
I have a fix , but I need to check it better.




> Also, a smaller issue: \input{...} doesn't seem to be
> setting cur_cs when using scan_toks, then the
> runaway error message reports it wrong:
>
>     \outer\def\boom{}
>     \input{\boom
>     \bye
>
> this reports:
>
>     Runaway text?
>     ! Forbidden control sequence found while scanning text of
> \csname\endcsname.
>     <inserted text>
>     }
>     <to be read again>
>     \boom
>     l.3 \input{\boom
>
>     ?


probably related.


--
luigi

Reply via email to