Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While event #3360

Merged
merged 15 commits into from
May 30, 2023
2 changes: 2 additions & 0 deletions chapters/arrays.tex
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ \subsubsection{Reduction Expressions}\label{reduction-expressions}
is a \firstuse{reduction expression}.
The expressions in the iterators of a reduction expression shall be vector expressions.
They are evaluated once for each reduction expression, and are evaluated in the scope immediately enclosing the reduction expression.
If \lstinline!expression1! contains event-generating expressions the reduction expression shall be an evaluable expression.
HansOlsson marked this conversation as resolved.
Show resolved Hide resolved

For an iterator:
\begin{lstlisting}[language=grammar]
Expand Down Expand Up @@ -753,6 +754,7 @@ \subsection{Constructor with Iterators}\label{array-constructor-with-iterators}\
\end{lstlisting}
is an \firstuse[array!constructor!with iterators]{array constructor with iterators}.
The expressions inside the iterators of an array constructor shall be vector expressions.
If \lstinline!expression! contains event-generating expressions the expression inside the iterators shall be an evaluable expression.
HansOlsson marked this conversation as resolved.
Show resolved Hide resolved
They are evaluated once for each array constructor, and are evaluated in the scope immediately enclosing the array constructor.

For an iterator:
Expand Down
6 changes: 6 additions & 0 deletions chapters/statements.tex
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ \subsection{For-Statement}\label{for-statement}
\end{lstlisting}
The rules for \lstinline!for!-statements are the same as for \lstinline!for!-expressions in \cref{explicit-iteration-ranges-of-for-equations} -- except that the \lstinline!expression! of a \lstinline!for!-statement is not restricted to a parameter-expression.

If the \lstinline!for!-statement contains expressions that will generate events, the range shall be an evaluable expression.
HansOlsson marked this conversation as resolved.
Show resolved Hide resolved
\begin{nonnormative}
In general, the same event-generating expression requires distinct crossing functions for different iterations of the \lstinline!for!-loop, and the restriction ensures that the number of crossing functions is known during translation time.
\end{nonnormative}
HansOlsson marked this conversation as resolved.
Show resolved Hide resolved
\begin{example}
\begin{lstlisting}[language=modelica]
for i in 1 : 10 loop // i takes the values 1, 2, 3, $\ldots$, 10
Expand Down Expand Up @@ -299,6 +303,8 @@ \subsection{While-Statement}\label{while-statement}
\item
If the \lstinline!expression! of the \lstinline!while!-statement is true, the entire body of the \lstinline!while!-statement is executed (except if a \lstinline!break!-statement, see \cref{break-statement}, or a \lstinline!return!-statement, see \cref{return-statements}, is executed), and then execution proceeds at step~\ref{while-execution-top}.
\end{enumerate}
Neither the \lstinline!expression! nor any expression in the body shall generate events.
HansOlsson marked this conversation as resolved.
Show resolved Hide resolved
A deprecated feature is that there is an implicit \lstinline!noEvent! for such \lstinline!while!-statement.
HansOlsson marked this conversation as resolved.
Show resolved Hide resolved

\subsection{Break-Statement}\label{break-statement}

Expand Down