On 8/29/2019 2:42 PM, Marcel Fabian Krüger wrote:
> Hello,
>
> in current versions of LuaTeX, `runtoks` does not preserve token lists
> of ongoing assignments. Therefore running `runtoks` inside of `\edef`
> or similar replace the definition with the defined value of the last
> inner assignment.
fixed in next luatex but in a different way as we then also need to
support deeper nesting
\toks2{\def\deepermacro{deeper}}
\toks0{\def\innermacro{inner}\def\deepermacro{weird}\directlua{tex.runtoks(2)}}
\edef\outermacro{outer\directlua{tex.runtoks(0)}}
\meaning\innermacro \par
\meaning\deepermacro\par
\meaning\outermacro \par