Skip to content

Commit

Permalink
Cleanup related to 'OldModifier'
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Nov 9, 2020
1 parent 78289e2 commit e79c0d3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions chapters/annotations.tex
Expand Up @@ -1521,20 +1521,19 @@ \subsubsection{Conversion rules}\label{conversion-rules}
\end{example}

\paragraph*{convertModifiers}\label{convertmodifiers}
\ % Dummy paragraph content to ensure listing below starts on a fresh line.

\begin{lstlisting}[language=modelica]
convertModifiers("OldClass",
{"OldModifier1=default1", "OldModifier2=default2", ...},
{"NewModifier1=...%OldModifier2%...", "NewModifier2=...", ...}
[, simplify=true] )
{"OldModifier1=default1", "OldModifier2=default2", $\ldots$},
{"NewModifier1=$\ldots$%OldModifier2%$\ldots$", "NewModifier2=$\ldots$", $\ldots$}
[, simplify=true])
\end{lstlisting}

Normal case; if any modifier among \lstinline!OldModifier! exist then replace all of
them with the list of \lstinline!NewModifiers!. The \lstinline!...%OldModifier2%...! indicate an expression that may
involve the values of the old modifiers (tools are responsible for adding parenthesis if needed).
Normal case; if any modifier among \lstinline!OldModifier! exist then replace all of them with the list of\linebreak[4] \lstinline!NewModifiers!.
The \lstinline!$\ldots$%OldModifier2%$\ldots$! indicate an expression that may involve the values of the old modifiers (tools are responsible for adding parenthesis if needed).
The lists of old and new modifiers can have different lengths.
The defaults (if present) are used if there
are multiple \lstinline!OldModifier! and not all are set in the component instance.
The defaults (if present) are used if there are multiple \lstinline!OldModifier! and not all are set in the component instance.
The defaults are optional if there is at most one \lstinline!OldModifier! element, and should otherwise be provided.

If \lstinline!simplify! is specified and true then perform obvious simplifications
Expand All @@ -1560,7 +1559,8 @@ \subsubsection{Conversion rules}\label{conversion-rules}
If \lstinline!OldModifier$i$! is \lstinline!cardinality(a) = 1! the conversion will only be applied for a component comp if there are any inside connections to \lstinline!comp.a!.
\end{itemize}

The converted modifiers and existing modifiers are merged such that the existing modifiers take precedence over the result of \lstinline!convertModifiers!. A diagnostics is recommended if this merging removes some modifiers unless those modifiers are identical or it is the special case of an empty OldModifier list.
The converted modifiers and existing modifiers are merged such that the existing modifiers take precedence over the result of \lstinline!convertModifiers!.
A diagnostics is recommended if this merging removes some modifiers unless those modifiers are identical or it is the special case of an empty \lstinline!OldModifier! list.
\begin{nonnormative}
This can be used to handle the case where the default value was changed.
\end{nonnormative}
Expand Down

0 comments on commit e79c0d3

Please sign in to comment.