From: Mark Wooding Date: Mon, 5 Aug 2019 15:13:13 +0000 (+0100) Subject: doc/sod.sty: Hoist `\@ifnextchar@preserve' further up. X-Git-Url: https://git.distorted.org.uk/~mdw/sod/commitdiff_plain/b13a8764b921cd77a8bdc540844601a99a78e8b2 doc/sod.sty: Hoist `\@ifnextchar@preserve' further up. --- diff --git a/doc/sod.sty b/doc/sod.sty index 531fce0..3560c62 100644 --- a/doc/sod.sty +++ b/doc/sod.sty @@ -116,6 +116,14 @@ \expandafter\@firstoftwo\expandafter\@scripts% \else\@tempa\expandafter\@scripts\fi} +%% Lookahead without eating spaces. +\def\@ifnextchar@preserve#1#2#3{% + \let\want@= #1\def\@tempa{#2}\def\@tempb{#3}% + \futurelet\nch@\@ifnch@p% +} +\def\@ifnch@p{% + \ifx\want@\nch@\expandafter\@tempa\else\expandafter\@tempb\fi} + %% Extra syntax for Lisp templates. These produce the maths-font versions of %% characters, which should contrast well against the sans face used for %% literals. @@ -363,13 +371,6 @@ } \def\desc@end{\endlist\after@desc\global\let\after@desc\saved@after@desc} -\def\@ifnextchar@preserve#1#2#3{% - \let\want@= #1\def\@tempa{#2}\def\@tempb{#3}% - \futurelet\nch@\@ifnch@p% -} -\def\@ifnch@p{% - \ifx\want@\nch@\expandafter\@tempa\else\expandafter\@tempb\fi} - \@namedef{describe*}#1{\desc@begin{#1}} \expandafter\let\csname enddescribe*\endcsname\desc@end \def\describe{\parse@dhd\desc@}