X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/ebf5ae2e5caf1e843c313328f43c9e8c6fda0081..5f32b8fda0421d16fc3455d1ce9aef746afbd818:/doc/sod.sty?ds=sidebyside

diff --git a/doc/sod.sty b/doc/sod.sty
index ed39c24..2b68df4 100644
--- a/doc/sod.sty
+++ b/doc/sod.sty
@@ -62,13 +62,14 @@
 \let\syntright\empty
 
 %% Literal code is in sans face.
-\let\codeface\sffamily
+\def\codeface{\upshape\sffamily}
 \DeclareRobustCommand\code[1]{%
   \ifmmode\hbox\else\leavevmode\fi%
   {\normalfont\codeface\/#1\/}%
 }
 \def\ulitleft{\normalfont\codeface}
 \let\ulitright\empty
+\def\lit@i#1#2#3{\ifmmode\leavevmode\hbox\fi{#1{#3\/}#2}}
 
 %% Conditionally enter maths mode.  Can't use \ensuremath here because we
 %% aren't necessarily sure where the maths will actually end.
@@ -79,7 +80,7 @@
 \atdef <#1>{\synt{#1}\@scripts}
 \atdef "#1"{\lit*{#1}\@scripts}
 \atdef `#1'{\lit{#1}\@scripts}
-\atdef |#1|{\textsf{#1}\@scripts}
+\atdef |#1|{\lit*{#1}\@scripts}
 
 %% A handy abbreviation; `\\' itself is too good to steal.
 \atdef \\{\textbackslash}
@@ -119,16 +120,24 @@
 \atdef -#1{\if>#1\hbox{--\raisebox{.4pt}{>}}\penalty200\relax\fi}
 
 %% Comment setting.
-\atdef ;#1\\{\normalfont\itshape;#1\\}
+\def\comment#1{\mbox{\normalfont\itshape\/#1\/}}
+\atdef /*#1*/{/*\comment{#1}*/}
+\def\@semis{\@ifnextchar;{;\@semis}\@semicomment}
+\def\@semicomment#1\\{\comment{#1}\\}
+\atdef ;#1\\{;\@semis}
 
 %% Environment for setting programs.  Newlines are explicit, because
 %% otherwise I need comments in weird places to make the vertical spacing
 %% come out properly.  You can write `\obeylines' if you really want to.
-\def\prog{\let\prog@@cr\@tabcr\let\@tabcr\@progcr\codeface\quote\tabbing}
+\def\@prog{\let\prog@@cr\@tabcr\let\@tabcr\@progcr\codeface\tabbing}
+\def\prog{\quote\@prog}
 \def\endprog{\endtabbing\endquote}
+\let\nprog\@prog
+\let\endnprog\endtabbing
 \def\ind{\quad\=\+\kill}
 \def\@progcr{\futurelet\@tempa\@progcr@i}
 {\def\:{\gdef\@progcr@sp}\: {\@progcr}}
+\atdef~{\textasciitilde}
 \def\@progcr@i{%
   \ifx\@tempa\@sptoken\let\next@\@progcr@sp\else
   \if1\ifx\@tempa[1\else
@@ -145,6 +154,7 @@
 \def\@progcr@ii#1{\csname @progcr@#1\endcsname\ignorespaces}
 \@namedef{@progcr@+}{\prog@@cr[\medskipamount]}
 \@namedef{@progcr@-}{\prog@@cr*[\jot]}
+\def\macsl{\`\textbackslash\hskip\leftmargin}
 
 %% Put a chunk of text in a box.
 \newenvironment{boxy}[1][\q@]{%
@@ -178,6 +188,7 @@
 \definedescribecategory{be-meth}{before method}
 \definedescribecategory{af-meth}{after method}
 \definedescribecategory{cls}{class}
+\definedescribecategory{rst}{restart}
 \definedescribecategory{ty}{type}
 \definedescribecategory{type}{type}
 \definedescribecategory{mac}{macro}
