blefloch / latex-unravel

Watching TeX digest tokens
24 stars 1 forks source link

\unravel fails on \char_generate:nn #24

Closed blefloch closed 6 years ago

blefloch commented 7 years ago
\RequirePackage{unravel}
\ExplSyntaxOn
\unravel{\char_generate:nn{65}{11}}

This stops after 99 steps, despite being in the middle of many expansions.

blefloch commented 7 years ago

Simpler case with the same error:

\unravel{ \ifcase 1 \expandafter \ifx \noexpand \X \X }
blefloch commented 7 years ago

A variant:

\unravel{\edef\foo{\expandafter\ifx\noexpand\X\X\fi}}

It seems the problem is the combination of \expandafter and \noexpand: the wrong token (here \ifx) is turned into \relax.

blefloch commented 7 years ago

Cases like \expandafter\show\expandafter\X\expandafter\show\noexpand\X mean that the \noexpand information really has to be stored with \X itself at the right position in the input stream. This is tough given the current approach of unravel. I'll think.

blefloch commented 6 years ago

Also on \cs_generate_variant:Nn.