chiark / gitweb /
doc/syntax.tex: Replace `listing' environments with `prog'.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 22 Jul 2017 17:13:30 +0000 (18:13 +0100)
doc/syntax.tex

index 64b10f46764658719d5b1b824610d4df3db93aaf..0b7456f57f2310bfebfed52df2f5755dd2dc7a1c 100644 (file)
@@ -578,17 +578,17 @@ keyword arguments.
 A @<class-forward-declaration> informs Sod that an @<identifier> will be used
 to name a class which is currently undefined.  Forward declarations are
 necessary in order to resolve certain kinds of circularity.  For example,
-\begin{listing}
+\begin{prog}
 class Sub;
-
-class Super : SodObject {
-  Sub *sub;
-};
-
-class Sub : Super {
-  /* ... */
-};
-\end{listing}
+\\+
+class Super : SodObject \{ \\ \ind
+  Sub *sub; \- \\
+\};
+\\+
+class Sub : Super \{ \\ \ind
+  /* \dots */ \- \\
+\};
+\end{prog}
 
 \subsubsection{Full class definitions}
 \begin{grammar}
@@ -664,20 +664,20 @@ functions are fine.
 An @<initializer>, if present, is treated as if a separate
 @<initializer-item> containing the slot name and initializer were present.
 For example,
-\begin{listing}
-[nick = eg]
-class Example : Super {
-  int foo = 17;
-};
-\end{listing}
+\begin{prog}
+[nick = eg] \\-
+class Example : Super \{ \\ \ind
+  int foo = 17; \- \\
+\};
+\end{prog}
 means the same as
-\begin{listing}
-[nick = eg]
-class Example : Super {
-  int foo;
-  eg.foo = 17;
-};
-\end{listing}
+\begin{prog}
+[nick = eg] \\-
+class Example : Super \{ \\ \ind
+  int foo; \\
+  eg.foo = 17; \- \\
+\};
+\end{prog}
 
 \subsubsection{Initializer items}
 \begin{grammar}