blefloch / latex-unravel

Watching TeX digest tokens
24 stars 1 forks source link

\number seems not correctly supported #37

Closed Skillmon closed 4 years ago

Skillmon commented 4 years ago

If the argument to \unravel is just a valid \number expression an error is thrown:

\documentclass{article}
\usepackage{unravel}
\begin{document}
\unravel{\number`a}
\end{document}

This throws:

Runaway argument?
\__unravel_print_outcome: \__unravel_final_test: \__unravel_exit_point: \ETC.
! File ended while scanning use of \__unravel_exit_error:w.
<inserted text>
                \par
jfbu commented 4 years ago

The expression is not properly terminated: with \unravel{\number`a } (added space token at the end) there is no issue.

jfbu commented 4 years ago

Same thing for \unravel{\the\count0} versus \unravel{\the\count0 }.

blefloch commented 4 years ago

I've opted for producing an error and adding \relax. It's not fool-proof, e.g. \unravel{\unexpanded} will repeatedly add \relax, but since it produces an error, that's more or less ok I guess.