Skip to content

Commit

Permalink
Cleanup related to 'String'
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Oct 13, 2020
1 parent 8894c48 commit 03b72e8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 36 deletions.
11 changes: 3 additions & 8 deletions chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -687,21 +687,16 @@ \subsection{Short Class Definitions}\label{short-class-definitions}

\subsection{Restriction on combining base-classes and other elements}\label{restriction-on-combining-base-classes-and-other-elements}

It is not legal to combine other components or base-classes with an
extends from an array class, a class with non-empty base-prefix, a
simple type (Real, Boolean, Integer, String and enumeration types), or
any class transitively extending from an array class, a class with
non-empty base-prefix, or a simple type (Real, Boolean, Integer, String
and enumeration types).
It is not legal to combine other components or base-classes with an extends from an array class, a class with non-empty base-prefix, a simple type (\lstinline!Real!, \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String! and enumeration types), or any class transitively extending from an array class, a class with non-empty base-prefix, or a simple type (\lstinline!Real!, \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String! and enumeration types).

\begin{example}
\begin{lstlisting}[language=modelica]
model Integrator
input Real u;
output Real y=x;
output Real y = x;
Real x;
equation
der(x)=u;
der(x) = u;
end Integrator;

model Integrators = Integrator[3]; // Legal
Expand Down
9 changes: 1 addition & 8 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1304,14 +1304,7 @@ \subsection{Using the Derivative Annotation}\label{using-the-derivative-annotati
\end{align*}
\end{example}

An input or output to the function may be any simple type (Real,
Boolean, Integer, String and enumeration types) or a record. For a
record containing Reals the corresponding derivative uses a derivative
record, that only contain the real-predefined types and sub-records
containing reals (handled recursively) from the original record. When
using \lstinline!smoothOrder!, then the derivative record is automatically
constructed. The function must have at least one input containing reals.
The output list of the derivative function shall not be empty.
An input or output to the function may be any simple type (\lstinline!Real!, \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String! and enumeration types) or a record. For a record containing Reals the corresponding derivative uses a derivative record, that only contain the real-predefined types and sub-records containing reals (handled recursively) from the original record. When using \lstinline!smoothOrder!, then the derivative record is automatically constructed. The function must have at least one input containing reals. The output list of the derivative function shall not be empty.

\begin{example}
Here is one example use case with records mixing \lstinline!Real! and
Expand Down
9 changes: 1 addition & 8 deletions chapters/lexicalstructure.tex
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,7 @@ \subsection{Boolean Literals}\label{boolean-literals}

\subsection{Strings}\label{strings}

String literals appear between double quotes as in \lstinline!"between"!. Any
character in the Modelica language character set (see \cref{lexical-conventions} for
allowed characters) apart from double quote (\lstinline!"!) and backslash
(\lstinline!\!), including new-line, can be \emph{directly} included
in a string without using an escape code. Certain characters in string
literals can be represented using escape codes, i.e., the character is
preceded by a backslash (\lstinline!\!) within the string. Those
characters are:
String literals appear between double quotes as in \lstinline!"between"!. Any character in the Modelica language character set (see \cref{lexical-conventions} for allowed characters) apart from double quote (\lstinline!"!) and backslash (\lstinline!\!), including new-line, can be \emph{directly} included in a string without using an escape code. Certain characters in string literals can be represented using escape codes, i.e., the character is preceded by a backslash (\lstinline!\!) within the string. Those characters are:
\begin{center}
\begin{tabular}{c l}
\hline
Expand Down
19 changes: 7 additions & 12 deletions chapters/revisions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ \subsection{Main changes in Modelica 3.4}\label{main-changes-in-modelica-3-4}
Added unbounded to Real, \cref{real-type} and \cref{attributes-start-fixed-nominal-and-unbounded}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/926}{\#926}.
\item
Added fixed-attribute for String, \cref{string-type}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1797}{\#1797}.
Added fixed-attribute for \lstinline!String!, \cref{string-type}.
Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/1797}{\#1797}.
\item
Clarified and corrected example in \cref{enumeration-types}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1849}{\#1849} and
Expand Down Expand Up @@ -325,7 +325,7 @@ \subsection{Main changes in Modelica 3.4}\label{main-changes-in-modelica-3-4}
\cref{simple-types}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1846}{\#1846}.
\item
Added that Strings can be sent to FORTRAN~77, \cref{simple-types}. Ticket
Added that strings can be sent to FORTRAN~77, \cref{simple-types}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1971}{\#1971}.
\item
Allow multiple include directories, \cref{annotations-for-external-libraries-and-include-files}. Ticket
Expand Down Expand Up @@ -466,9 +466,8 @@ \subsection{Main changes in Modelica 3.3 Revision 1}\label{main-changes-in-model
addition the following improvements were made:
\begin{itemize}
\item
Clarified that String-operator cannot use positional arguments,
\cref{numeric-functions-and-conversion-functions}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1468}{\#1468}.
Clarified that \lstinline!String! operator cannot use positional arguments, \cref{numeric-functions-and-conversion-functions}.
Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/1468}{\#1468}.
\item
Corrected size of enumeration, \cref{numeric-functions-and-conversion-functions} and \cref{type-conversion-of-enumeration-values-to-string-or-integer}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1369}{\#1369}.
Expand Down Expand Up @@ -2040,8 +2039,7 @@ \subsection{Main Changes in Modelica 2.1}\label{main-changes-in-modelica-2-1}
\item
Statement \lstinline!return! in a Modelica function.
\item
Built-in function \lstinline!String! to provide a string representation of
\lstinline!Boolean!, \lstinline!Integer!, \lstinline!Real! and \lstinline!Enumeration! types.
Built-in function \lstinline!String! to provide a string representation of \lstinline!Boolean!, \lstinline!Integer!, \lstinline!Real! and \lstinline!Enumeration! types.
\item
Built-in function \lstinline!Integer! to provide the \lstinline!Integer! representation of
an \lstinline!Enumeration! type.
Expand Down Expand Up @@ -2291,10 +2289,7 @@ \subsection{Main Changes in Modelica 1.4}\label{main-changes-in-modelica-1-4}
automatically generated when the result value of one of these operator
changes discontinuously.
\item
Quantity attribute also for base types Boolean, Integer, String (and
not only for Real), in order to allow abstracted variables to refer to
physical quantities (e.g.\ \lstinline!Boolean i(quantity="Current")! is true if
current is flowing and is false if no current is flowing).
Quantity attribute also for base types \lstinline!Boolean!, \lstinline!Integer!, \lstinline!String! (and not only for \lstinline!Real!), in order to allow abstracted variables to refer to physical quantities (e.g.\ \lstinline!Boolean i(quantity="Current")! is true if current is flowing and is false if no current is flowing).
\item
\lstinline!final! keyword also allowed in declaration, to prevent modification.
Example:
Expand Down

0 comments on commit 03b72e8

Please sign in to comment.