Skip to content

Commit

Permalink
Require that the strings are non-empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Feb 22, 2024
1 parent 260db96 commit 4ff775b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions chapters/annotations.tex
Expand Up @@ -1747,13 +1747,15 @@ \subsubsection{Conversion Rules}\label{conversion-rules}
The conversion should generate correct Modelica models using the new version of the library
corresponding to the old version.

The string arguments for these functions should not be the empty string (except for the string in an empty array of strings).

\begin{nonnormative}
Whenever possible tools should preserve the original style of the model, e.g., use of imports.
Conversions should be applied in all places where named element are used in code, including Modelica URIs (for example, in \lstinline!Documentation! annotations).
\end{nonnormative}

These functions can be called with literal strings or array of strings
and vectorize according to \cref{scalar-functions-applied-to-array-arguments}.
These functions can be called with literal strings or array of strings and vectorize according to \cref{scalar-functions-applied-to-array-arguments}.
The literal strings must not be the empty string (an empty array of strings is allowed).

All of these convert-functions only use inheritance among user models, and not in the library that is used for the conversion -- thus conversions of base classes will require multiple conversion calls; this ensures that the conversion is independent of the new library structure.
The name of the class used as argument to \lstinline!convertElement! and \lstinline!convertModifiers! is similarly the old name of the class, i.e., the name before it is possibly converted by \lstinline!convertClass!.
Expand All @@ -1762,6 +1764,8 @@ \subsubsection{Conversion Rules}\label{conversion-rules}
Specifying conversions using the old name of a class allows the conversion to be done without access to the old
version of the library (by suitable modifications of the lookup). Another alternative is to use the old version
of the library during the conversion.

An empty string would mean either mean an empty diagnostics or a missing class, component, or modifier which does not make sense.
\end{nonnormative}

\paragraph*{convertClass("OldClass", "NewClass")}\label{convertclassoldclassnewclass}\annotationindex{convertClass}
Expand Down

0 comments on commit 4ff775b

Please sign in to comment.