pub fn scan_stops_at_futurelet_peek(defn: &Rc<dyn Definition>) -> boolExpand description
TeX’s number scan stops at the unexpandable head of a peeking macro.
latex.ltx’s \@ifnextchar (1756-1760), and with it \@ifstar,
\@testopt and every \newcommand optional argument, opens with \let
and peeks by \futurelet; the digits of a number scan end at the first
unexpandable token (tex.web §445), so the peek happens only where the
macro is executed. Our peeking macros are closures that peek as they
expand: in a scan they stay unexpanded, the scan ends at them, and the
next reader outside the scan (the main loop, an alignment’s cell-head
peek) expands them. Expanding them in the scan read the chosen branch
into the number (\count@=1\@ifstar{7}{5}* assigned 17), or its
conditionals into a false branch’s skip: egpeirce.sty:184-189 \ifodd \the\value{cutdepth}% + \psset → \XKV@ifstar exposed
\let\ifXKV@st\iffalse and the skip ran off the end of the document
(egpeirce-doc, 51 errors; Perl shares the bug). Guards:
cluster_package_guards::ifnextchar_scans.