From dec293941a8076d7fa1e0cb4f0fa087ad6b28218 Mon Sep 17 00:00:00 2001 From: HOS Date: Wed, 14 Dec 2022 15:10:45 +0100 Subject: [PATCH] Revert "Merge remote-tracking branch 'origin/ClarifyEach' into ConstrainArrayAssignment" This reverts commit de1b6a6545238584621ed3b36a7d7b9333702ac6, reversing changes made to 2d4a795bf35799b0740c72fe6577949d1200a8ae. --- chapters/abstract.tex | 2 +- chapters/equations.tex | 2 +- chapters/inheritance.tex | 13 ++----------- chapters/operatorsandexpressions.tex | 2 +- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/chapters/abstract.tex b/chapters/abstract.tex index a8f65088e..d9b1f7dd0 100644 --- a/chapters/abstract.tex +++ b/chapters/abstract.tex @@ -1,5 +1,5 @@ % Can't use the 'abstract' environment as long as LaTeXML puts the abstract before the title page, see LaTeXML issue: -% - https://github.com/brucemiller/LaTeXML/issues/1395 (fixed on master 2022-12-10) +% - https://github.com/brucemiller/LaTeXML/issues/1395 \begin{center} \large\bfseries\sffamily \abstractname diff --git a/chapters/equations.tex b/chapters/equations.tex index b695547eb..2f73bd917 100644 --- a/chapters/equations.tex +++ b/chapters/equations.tex @@ -731,7 +731,7 @@ \section{Initialization, initial equation, and initial algorithm}\label{initiali but not in one of the specific forms, the \lstinline!when!-clause is not active during initialization: \lstinline!when not initial() then print("simulation started"); end when;! \end{nonnormative} -The algorithmic statements within a \lstinline!when!-statement are active during initialization, if and only if they are explicitly enabled with \lstinline!initial()!, and only in one of the two forms \lstinline!when initial() then! or \lstinline!when {$\ldots$, initial(), $\ldots$} then!. +The algorithmic statements within a \lstinline!when!-statement are active during initialization, if and only they are explicitly enabled with \lstinline!initial()!, and only in one of the two forms \lstinline!when initial() then! or \lstinline!when {$\ldots$, initial(), $\ldots$} then!. In this case, the algorithmic statements within the \lstinline!when!-statement remain active during the whole initialization phase. An active \lstinline!when!-clause inactivates the following \lstinline!elsewhen! (similarly as for \lstinline!when!-clauses during simulation), but apart from that the first \lstinline!elsewhen initial() then! or \lstinline!elsewhen {$\ldots$, initial(), $\ldots$} then! is similarly active during initialization as \lstinline!when initial() then! or \lstinline!when {$\ldots$, initial(), $\ldots$} then!. diff --git a/chapters/inheritance.tex b/chapters/inheritance.tex index b8fbd2c9d..a6d35169a 100644 --- a/chapters/inheritance.tex +++ b/chapters/inheritance.tex @@ -459,7 +459,7 @@ \subsection{Modifiers for Array Elements}\label{modifiers-for-array-elements} The following rules apply to modifiers: \begin{itemize} \item - The \lstinline!each!\indexinline{each} keyword on a modifier requires that it is applied inside an array declaration or modification of an array, and the modifier is applied individually to each element of the enclosing array (with regard to the position of \lstinline!each!). + The \lstinline!each!\indexinline{each} keyword on a modifier requires that it is applied in an array declaration/modification, and the modifier is applied individually to each element of the enclosing array (with regard to the position of \lstinline!each!). In case of nested modifiers this implies it is applied individually to each element of each element of the enclosing array; see example. If the modified element is a vector and the modifier does not contain the \lstinline!each! prefix, the modification is split such that the first element in the vector is applied to the first element of the vector of elements, the second to the second element, until the last element of the vector is applied to the last element of the array; it is an error if these sizes do not match. Matrices and general arrays of elements are treated by viewing those as vectors of vectors etc. @@ -477,7 +477,7 @@ \subsection{Modifiers for Array Elements}\label{modifiers-for-array-elements} model B C c[5](each a = {1, 2, 3}, d = {1, 2, 3, 4, 5}); - parameter Real p = 0; + parameter Real b = 0; end B; \end{lstlisting} This implies \lstinline!c[i].a[j] = j! and \lstinline!c[i].d = i!. @@ -508,15 +508,6 @@ \subsection{Modifiers for Array Elements}\label{modifiers-for-array-elements} Real[2] work2(each start = 2); // Legal end F; \end{lstlisting} -Note that the array is not necessarily the closest enclosing identifier. -\begin{lstlisting}[language=modelica] -model G - C c[2](each a = {1, 2, 3}, d(start={4, 5}, each fixed=true)); - // The second each relies on c being an array, - // without the second each we would have to write: - C c2[2](each a = {1, 2, 3}, d(start={4, 5}, fixed=fill(true, 2))); -end G; -\end{lstlisting} \end{example} \subsection{Final Element Modification Prevention}\label{final-element-modification-prevention} diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 39cb64c22..289806ec8 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -48,7 +48,7 @@ \section{Operator Precedence and Associativity}\label{operator-precedence-and-as All operators are binary except the postfix operators and those shown as unary together with \emph{expr}, the conditional operator, the array construction operator % Beware that the array construction operator, normally expressed as \lstinline!{ }! needs escaped braces inside \caption. % This isn't handled correctly by LaTeXML, as reported here: -% - https://github.com/brucemiller/LaTeXML/issues/1377 (fixed on master 2022-12-10) +% - https://github.com/brucemiller/LaTeXML/issues/1377 \ifpdf \lstinline!\{ \}! % Intentional space at end of line. \else