From 219c56aa0b887e211dbdd8269cd32e877a33b82e Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Tue, 12 Jan 2021 07:39:32 +0100 Subject: [PATCH] Use angle brackets for '' in listings This fixes at least the cases using \textless{}, but there could be more cases that didn't escape into text mode that have been missed. --- chapters/classes.tex | 7 ++----- chapters/connectors.tex | 3 ++- chapters/functions.tex | 6 +++--- chapters/lexicalstructure.tex | 10 +++------- chapters/revisions.tex | 3 +-- chapters/statements.tex | 9 +++------ chapters/synchronous.tex | 4 ++-- chapters/syntax.tex | 5 ++--- 8 files changed, 18 insertions(+), 29 deletions(-) diff --git a/chapters/classes.tex b/chapters/classes.tex index 7cad0b634..12b557c2c 100644 --- a/chapters/classes.tex +++ b/chapters/classes.tex @@ -1562,7 +1562,7 @@ \subsubsection{Attributes of Enumeration Types}\label{attributes-of-enumeration- \subsubsection{Type Conversion of Enumeration Values to String or Integer}\label{type-conversion-of-enumeration-values-to-string-or-integer} -The type conversion function \lstinline!Integer($\mbox{\emph{\textless{}expression of enumeration type\textgreater{}}}$)! returns the ordinal number of the enumeration value \lstinline!E.enumvalue!, to which the expression is evaluated, where $\text{\lstinline!Integer(E.e1)!} = 1$, $\text{\lstinline!Integer(E.en)!} = n$, for an enumeration type \lstinline!E = enumeration(e1, $\ldots$, en)!. +The type conversion function \lstinline!Integer($\langle\mbox{\emph{expression of enumeration type}}\rangle$)! returns the ordinal number of the enumeration value \lstinline!E.enumvalue!, to which the expression is evaluated, where $\text{\lstinline!Integer(E.e1)!} = 1$, $\text{\lstinline!Integer(E.en)!} = n$, for an enumeration type \lstinline!E = enumeration(e1, $\ldots$, en)!. \lstinline!String(E.enumvalue)! gives the \lstinline!String! representation of the enumeration value. @@ -1579,10 +1579,7 @@ \subsubsection{Type Conversion of Integer to Enumeration Values}\label{type-conv implicitly defined. This function can be used in an expression to convert an integer value to the corresponding (as described in \cref{type-conversion-of-enumeration-values-to-string-or-integer}) enumeration value. -For an enumeration type named \lstinline!EnumTypeName!, the expression -\lstinline!EnumTypeName()! returns the -enumeration value \lstinline!EnumTypeName.e! such that \lstinline!Integer(EnumTypeName.e)! is -equal to the original integer expression. +For an enumeration type named \lstinline!EnumTypeName!, the expression \lstinline!EnumTypeName($\langle\mbox{\emph{Integer expression}}\rangle$)! returns the enumeration value \lstinline!EnumTypeName.e! such that \lstinline!Integer(EnumTypeName.e)! is equal to the original integer expression. Attempting to convert an integer argument that does not correspond to a value of the enumeration type is an error. diff --git a/chapters/connectors.tex b/chapters/connectors.tex index c613d1c8f..315908693 100644 --- a/chapters/connectors.tex +++ b/chapters/connectors.tex @@ -875,7 +875,8 @@ \subsection{Overconstrained Equation Operators for Connection Graphs}\label{over This function can be used at all places where a \lstinline!connect! statement is allowed. \begin{nonnormative} -E.g., it is not allowed to use this function in a when-clause. This definition shall be used if in a model with connectors \lstinline!A! and \lstinline!B! the overdetermined records \lstinline!A.R! and \lstinline!B.R! are algebraically coupled in the model, e.g., due to \lstinline!B.R = f(A.R!, \textless{}other unknowns\textgreater{}). +E.g., it is not allowed to use this function in a when-clause. +This definition shall be used if in a model with connectors \lstinline!A! and \lstinline!B! the overdetermined records \lstinline!A.R! and \lstinline!B.R! are algebraically coupled in the model, e.g., due to \lstinline!B.R = f(A.R, $\langle\mbox{\emph{other unknowns}}\rangle$)!. \end{nonnormative} \end{semantics} \end{operatordefinition} diff --git a/chapters/functions.tex b/chapters/functions.tex index 3a75a863b..349e282a4 100644 --- a/chapters/functions.tex +++ b/chapters/functions.tex @@ -12,7 +12,7 @@ \section{Function Declaration}\label{function-declaration} \begin{nonnormative} The structure of a typical function declaration is sketched by the following schematic function example: -\begin{lstlisting}[language=modelica,escapechar=!] +\begin{lstlisting}[language=modelica] function $\mathit{functionname}$ input TypeI1 in1; input TypeI2 in2; @@ -22,10 +22,10 @@ \section{Function Declaration}\label{function-declaration} output TypeO2 out2 = $\mathit{defaultExpr}_{2}$; $\ldots$ protected - !\emph{\textless{}local variables\textgreater{}}! + $\langle\mbox{\emph{local variables}}\rangle$ $\ldots$ algorithm - !\emph{\textless{}statements\textgreater{}}! + $\langle\mbox{\emph{statements}}\rangle$ $\ldots$ end $\mathit{functionname}$; \end{lstlisting} diff --git a/chapters/lexicalstructure.tex b/chapters/lexicalstructure.tex index 96fdf42fc..268a47de4 100644 --- a/chapters/lexicalstructure.tex +++ b/chapters/lexicalstructure.tex @@ -21,13 +21,9 @@ \section{Character Set}\label{character-set} \section{Comments}\label{comments} -There are two kinds of comments in Modelica which are not lexical units -in the language and therefore are treated as white-space by a Modelica -translator. The white-space characters are space, tabulator, and line -separators (carriage return and line feed); and white-space cannot occur -inside tokens, e.g., \textless{}= must be written as two characters -without space or comments between them. The following comment variants are -available: +There are two kinds of comments in Modelica which are not lexical units in the language and therefore are treated as white-space by a Modelica translator. +The white-space characters are space, tabulator, and line separators (carriage return and line feed); and white-space cannot occur inside tokens, e.g., \lstinline!<=! must be written as two characters without space or comments between them. +The following comment variants are available: %TODO-FORMAT should be a table instead of lstlisting? \begin{lstlisting}[language=modelica] // comment & Characters from // to the end of the line are ignored. diff --git a/chapters/revisions.tex b/chapters/revisions.tex index ed3dbe746..5086a5c53 100644 --- a/chapters/revisions.tex +++ b/chapters/revisions.tex @@ -1444,8 +1444,7 @@ \subsection{Main changes in Modelica 3.2 Revision 1}\label{main-changes-in-model Improved the definition of \lstinline!reinit!. \item \cref{discrete-time-expressions} Discrete-Time Expressions\\ - Improved definition of ordered relations - (\textgreater{},\textless{},\textgreater{}=,\textless{}=). + Improved definition of ordered relations (\lstinline!>!, \lstinline!=!, \lstinline!<=!). \item \cref{conditional-component-declaration} Conditional Component Declaration\\ Clarified redeclaration of a component. diff --git a/chapters/statements.tex b/chapters/statements.tex index db0267616..6dc7319bc 100644 --- a/chapters/statements.tex +++ b/chapters/statements.tex @@ -139,12 +139,9 @@ \subsection{Simple Assignment Statements}\label{simple-assignment-statements} \subsubsection{Assignments from Called Functions with Multiple Results}\label{assignments-from-called-functions-with-multiple-results} -There is a special form of assignment statement that is used only when -the right-hand side contains a call to a function with multiple results. -The left-hand side contains a parenthesized, comma-separated list of -variables receiving the results from the function call. A function with -\emph{n} results needs \emph{m\textless{}=n} receiving variables on the -left-hand side, and the variables are assigned from left to right. +There is a special form of assignment statement that is used only when the right-hand side contains a call to a function with multiple results. +The left-hand side contains a parenthesized, comma-separated list of variables receiving the results from the function call. +A function with $n$ results needs $m \leq n$ receiving variables on the left-hand side, and the variables are assigned from left to right. \begin{lstlisting}[language=modelica] (out1, out2, out3) := function_name(in1, in2, in3, in4); diff --git a/chapters/synchronous.tex b/chapters/synchronous.tex index 0b15c2a6e..c598cdaf0 100644 --- a/chapters/synchronous.tex +++ b/chapters/synchronous.tex @@ -812,9 +812,9 @@ \subsection{Sub-clock conversion operators}\label{sub-clock-conversion-operators \section{Clocked When-Clause}\label{clocked-when-clause} In addition to the previously discussed conditional when-clause, a \emph{clocked} when-clause\index{clocked!when-clause}\index{when-clause!clocked} is introduced: -\begin{lstlisting}[language=modelica,escapechar=!] +\begin{lstlisting}[language=modelica] when $\mathit{clockExpression}$ then - !\emph{\textless{}clocked equations\textgreater{}}! + $\langle\mbox{\emph{clocked equations}}\rangle$ $\ldots$ end when; \end{lstlisting} diff --git a/chapters/syntax.tex b/chapters/syntax.tex index 709b76446..49850872f 100644 --- a/chapters/syntax.tex +++ b/chapters/syntax.tex @@ -60,9 +60,8 @@ \section{Lexical conventions}\label{lexical-conventions} other strings have to contain only the sub-set of Unicode characters identical with the 7-bit US-ASCII character set. \begin{nonnormative} - As a consequence, operators like `\textgreater{}' or `\textless{}', and external functions only operate on ASCII strings and not on Unicode-strings. - Within a description-string the tags \lstinline!! and \lstinline!! or \lstinline!! and \lstinline!! define optionally begin - and end of content that is HTML encoded. + As a consequence, operators like `\lstinline!>!' or `\lstinline!! and \lstinline!! or \lstinline!! and \lstinline!! define optionally begin and end of content that is HTML encoded. \end{nonnormative} \item Boldface denotes keywords of the Modelica language. Keywords are