blefloch / latex-unravel

Watching TeX digest tokens
24 stars 1 forks source link

One step too many when skipping steps using u #34

Closed schtandard closed 4 years ago

schtandard commented 5 years ago

When I use u\foo to skip some steps, unravel skips steps until \foo is in the front of the input stream and then performs one more step. An example interactive session (the last keyboard input was hitting Enter after typing u\new@command):

> pdflatex
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7050 64-bit)
**\documentclass{article}\usepackage{unravel}\unravel{\newcommand\foo{asdf}}
entering extended mode
LaTeX2e <2018-12-01>
("C:\Program Files\MiKTeX 2.9\tex/latex/base\article.cls"
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex/latex/base\size10.clo"))
("C:\Program Files\MiKTeX 2.9\tex/latex/unravel\unravel.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/l3kernel\expl3.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/l3kernel\expl3-code.tex")
("C:\Program Files\MiKTeX 2.9\tex/latex/l3kernel\l3pdfmode.def"))
("C:\Program Files\MiKTeX 2.9\tex/latex/l3packages/xparse\xparse.sty")
("C:\Program Files\MiKTeX 2.9\tex/generic/gtl\gtl.sty"))

======== Welcome to the unravel package ========
    "<|" denotes the output to TeX's stomach.
    "||" denotes tokens waiting to be used.
    "|>" denotes tokens that we will act on.
    Press <enter> to continue; 'h' <enter> for help.

||
|> \newcommand \foo {asdf}
u\new@command
[===== Step 1 =====] \newcommand = macro:->\@star@or@long \new@command
[===== Step 2 =====] \@star@or@long = macro:#1->\@ifstar {\let \l@ng...
[===== Step 3 =====] \@ifstar = macro:#1->\@ifnextchar *{\@firstoftw...
[===== Step 4 =====] \@ifnextchar = \long macro:#1#2#3->\let \reserv...
[===== Step 5 =====] \let \reserved@d
[===== Step 6 =====] Set \reserved@d=the character *
[===== Step 7 =====] \def \reserved@a {\@firstoftwo {\let \l@ngrel@x...
[===== Step 8 =====] Set \reserved@a=macro:->\@firstoftwo {\let \l@n...
[===== Step 9 =====] \def \reserved@b {\let \l@ngrel@x \long \new@co...
[===== Step 10 =====] Set \reserved@b=macro:->\let \l@ngrel@x \long \...
[===== Step 11 =====] \futurelet \@let@token
[===== Step 12 =====] Set \@let@token=undefined
[===== Step 13 =====] \@ifnch = macro:->\ifx \@let@token \@sptoken \l...
[===== Step 14 =====] \ifx = \ifx
[===== Step 15 =====] Compare: \ifx \@let@token \@sptoken =false => s...
[===== Step 16 =====] \ifx = \ifx
[===== Step 17 =====] Compare: \ifx \@let@token \reserved@d =false =>...
[===== Step 18 =====] \let \reserved@c
[===== Step 19 =====] Set \reserved@c=macro:->\let \l@ngrel@x \long \...
[===== Step 20 =====] \fi = \fi
[===== Step 21 =====] \fi = \fi
[===== Step 22 =====] \reserved@c = macro:->\let \l@ngrel@x \long \ne...
[===== Step 23 =====] \let \l@ngrel@x
[===== Step 24 =====] Set \l@ngrel@x=\long
||
|> \new@command \foo {asdf}
[===== Step 25 =====] \new@command = macro:#1->\@testopt {\@newcomman...
||
|> \@testopt {\@newcommand \foo }0{asdf}

(I am using Windows 10's PowerShell with MiKTeX's pdflatex.)