From 4ff775baa2bf7efe3a5a96b1b818115ef7617a29 Mon Sep 17 00:00:00 2001 From: HOS Date: Thu, 22 Feb 2024 16:41:29 +0100 Subject: [PATCH] Require that the strings are non-empty. Closes #3459 --- chapters/annotations.tex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chapters/annotations.tex b/chapters/annotations.tex index fc501f809..029a06097 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -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!. @@ -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}