Skip to content

Commit

Permalink
Use angle brackets for '<describing text>' in listings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
henrikt-ma committed Jan 12, 2021
1 parent 15cca7e commit 219c56a
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 29 deletions.
7 changes: 2 additions & 5 deletions chapters/classes.tex
Expand Up @@ -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.

Expand All @@ -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(<Integer expression>)! 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.
Expand Down
3 changes: 2 additions & 1 deletion chapters/connectors.tex
Expand Up @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions chapters/functions.tex
Expand Up @@ -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;
Expand All @@ -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}
Expand Down
10 changes: 3 additions & 7 deletions chapters/lexicalstructure.tex
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions chapters/revisions.tex
Expand Up @@ -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!>=!, \lstinline!<=!).
\item
\cref{conditional-component-declaration} Conditional Component Declaration\\
Clarified redeclaration of a component.
Expand Down
9 changes: 3 additions & 6 deletions chapters/statements.tex
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions chapters/synchronous.tex
Expand Up @@ -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}
Expand Down
5 changes: 2 additions & 3 deletions chapters/syntax.tex
Expand Up @@ -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!<HTML>! and \lstinline!</HTML>! or \lstinline!<html>! and \lstinline!</html>! define optionally begin
and end of content that is HTML encoded.
As a consequence, operators like `\lstinline!>!' or `\lstinline!<!', and external functions only operate on ASCII strings and not on Unicode-strings.
Within a description-string the tags \lstinline!<HTML>! and \lstinline!</HTML>! or \lstinline!<html>! and \lstinline!</html>! define optionally begin and end of content that is HTML encoded.
\end{nonnormative}
\item
Boldface denotes keywords of the Modelica language. Keywords are
Expand Down

0 comments on commit 219c56a

Please sign in to comment.