Skip to content

Commit c28a66d

Browse files
committed
docs: statement ordering exceptions
Provide a more precise description of mixed statements. Add descriptions for Format and ModuleOption.
1 parent 2f13c32 commit c28a66d

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

doc/manual/module.tex

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,42 @@ \chapter{Modules}
3131
\item [Definitions\index{definitions}] These define new expressions.
3232
\item [Executable\index{executable statements} statements] The operations
3333
on all active expressions.
34-
\item [OutputSpecifications\index{output specifications}] These specify the
34+
\item [Output specifications\index{output specifications}] These specify the
3535
output representation.
3636
\item [End-of-module specifications\index{end of module specifications}]
3737
Extra settings that are for this module only.
3838
\item [Mixed statements\index{mixed statements}] They can occur in various
3939
classes. Most notably the print statement.
4040
\end{description}
4141
Statements must occur in such an order that no statement follows a
42-
statement of a later category. The only exception is formed by the mixed
43-
statements, which can occur anywhere. This is different from earlier
42+
statement of a later category, except as described bellow.
43+
This is different from earlier
4444
versions of \FORM\ in which the order of the statements was not fixed. This
4545
did cause a certain amount of confusion about the workings of \FORM\@.
4646

47+
The exceptions are:
48+
\begin{itemize}
49+
\item Mixed statements are permitted in the executable statements,
50+
output specifications, and end-of-module specifications parts of a module.
51+
\item \texttt{Format}\index{format} statements are permitted anywhere.
52+
\item \texttt{ModuleOption}\index{moduleoption} statements that control how \$-variables are handled
53+
during parallel execution are permitted anywhere.
54+
\end{itemize}
55+
The last exception allows such \texttt{ModuleOption} statements to appear inside procedures
56+
that use \$-variables and do not contain a \texttt{.sort}.
57+
For example, the following structure is valid:
58+
\begin{verbatim}
59+
#procedure SortlessProc
60+
$procLocalDollar = ...
61+
ModuleOption local $procLocalDollar;
62+
* more executable statements here
63+
#endprocedure
64+
65+
#call SortlessProc
66+
* more executable statements here
67+
.sort
68+
\end{verbatim}
69+
4770
There are several types of modules.
4871
\begin{description}
4972
\item[.sort\index{.sort}] \label{instrsort} The general end-of-module.

0 commit comments

Comments
 (0)