Skip to content

Commit

Permalink
FullyUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Nov 20, 2020
1 parent 44f59be commit feb3bc8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
26 changes: 13 additions & 13 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1744,11 +1744,11 @@ \subsubsection{Simple Types}\label{simple-types}
& \multicolumn{1}{c}{\tablehead{Input}} & \multicolumn{1}{c}{\tablehead{Output}}\\
\hline
\hline
\lstinline!Real! & \lstinline[language=fortran77]!DOUBLE PRECISION! & \lstinline[language=fortran77]!DOUBLE PRECISION!\\
\lstinline!Integer! & \lstinline[language=fortran77]!INTEGER! & \lstinline[language=fortran77]!INTEGER!\\
\lstinline!Boolean! & \lstinline[language=fortran77]!LOGICAL! & \lstinline[language=fortran77]!LOGICAL!\\
\lstinline!Real! & \lstinline[language=FORTRAN77]!DOUBLE PRECISION! & \lstinline[language=FORTRAN77]!DOUBLE PRECISION!\\
\lstinline!Integer! & \lstinline[language=FORTRAN77]!INTEGER! & \lstinline[language=FORTRAN77]!INTEGER!\\
\lstinline!Boolean! & \lstinline[language=FORTRAN77]!LOGICAL! & \lstinline[language=FORTRAN77]!LOGICAL!\\
\lstinline!String! & \emph{Special} & \emph{Not available}\\
Enumeration type & \lstinline[language=fortran77]!INTEGER! & \lstinline[language=fortran77]!INTEGER!\\
Enumeration type & \lstinline[language=FORTRAN77]!INTEGER! & \lstinline[language=FORTRAN77]!INTEGER!\\
\hline
\end{tabular}
\end{center}
Expand Down Expand Up @@ -1821,13 +1821,13 @@ \subsubsection{Arrays}\label{arrays-1}
\hline
\hline
\lstinline!T[$\mathit{dim}_{1}$]! &
\lstinline[language=fortran77]!T', INTEGER $\mathit{dim}_{1}$!
\lstinline[language=FORTRAN77]!T', INTEGER $\mathit{dim}_{1}$!
\\
\lstinline!T[$\mathit{dim}_{1}$, $\mathit{dim}_{2}$]! &
\lstinline[language=fortran77]!T', INTEGER $\mathit{dim}_{1}$, INTEGER $\mathit{dim}_{2}$!
\lstinline[language=FORTRAN77]!T', INTEGER $\mathit{dim}_{1}$, INTEGER $\mathit{dim}_{2}$!
\\
\lstinline!T[$\mathit{dim}_{1}$, $\ldots$, $\mathit{dim}_{n}$]! &
\lstinline[language=fortran77]!T', INTEGER $\mathit{dim}_{1}$, $\ldots$, INTEGER $\mathit{dim}_{n}$!
\lstinline[language=FORTRAN77]!T', INTEGER $\mathit{dim}_{1}$, $\ldots$, INTEGER $\mathit{dim}_{n}$!
\\
\hline
\end{tabular}
Expand Down Expand Up @@ -1859,7 +1859,7 @@ \subsubsection{Arrays}\label{arrays-1}
\end{lstlisting}
the default assumptions correspond to a FORTRAN~77 function
defined as follows:
\begin{lstlisting}[language=fortran77]
\begin{lstlisting}[language=FORTRAN77]
FUNCTION foo(a, d1, d2, d3)
DOUBLE PRECISION(d1, d2, d3) a
INTEGER d1
Expand Down Expand Up @@ -1891,7 +1891,7 @@ \subsubsection{Arrays}\label{arrays-1}
end foo;
\end{lstlisting}
The corresponding FORTRAN~77 subroutine would be declared as follows:
\begin{lstlisting}[language=fortran77]
\begin{lstlisting}[language=FORTRAN77]
SUBROUTINE myfoo(x, y, n, m, u1, i, u2)
DOUBLE PRECISION(n) x
DOUBLE PRECISION(n,m) y
Expand Down Expand Up @@ -1981,12 +1981,12 @@ \subsection{Return Type Mapping}\label{return-type-mapping}
\multicolumn{1}{c|}{\tablehead{Modelica}} & \multicolumn{1}{c|}{\tablehead{C}} & \multicolumn{1}{c}{\tablehead{FORTRAN~77}}\\
\hline
\hline
\lstinline!Real! & \lstinline[language=C]!double! & \lstinline[language=fortran77]!DOUBLE PRECISION!\\
\lstinline!Integer! & \lstinline[language=C]!int! & \lstinline[language=fortran77]!INTEGER!\\
\lstinline!Boolean! & \lstinline[language=C]!int! & \lstinline[language=fortran77]!LOGICAL!\\
\lstinline!Real! & \lstinline[language=C]!double! & \lstinline[language=FORTRAN77]!DOUBLE PRECISION!\\
\lstinline!Integer! & \lstinline[language=C]!int! & \lstinline[language=FORTRAN77]!INTEGER!\\
\lstinline!Boolean! & \lstinline[language=C]!int! & \lstinline[language=FORTRAN77]!LOGICAL!\\
\lstinline!String! & \lstinline[language=C]!const char*! & \emph{Not allowed}\\
\lstinline!T[$\mathit{dim}_{1}$, $\ldots$, $\mathit{dim}_{n}$]! & \emph{Not allowed} & \emph{Not allowed} \\
Enumeration type & \lstinline[language=C]!int! & \lstinline[language=fortran77]!INTEGER!\\
Enumeration type & \lstinline[language=C]!int! & \lstinline[language=FORTRAN77]!INTEGER!\\
Record & See \cref{records} & \emph{Not allowed}\\
\hline
\end{tabular}
Expand Down
9 changes: 5 additions & 4 deletions mlsshared.sty
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
terminal,noEvent,smooth,sample,pre,edge,change,reinit,%
previous,hold,subSample,superSample,shiftSample,backSample,noClock,firstTick,interval,%
Real,Integer,Boolean,String},%
sensitive=true, % just in case
comment=[l]{//}, % comment lines
morecomment=[s]{/*}{*/}, % comment blocs
morestring=[b]{'},
Expand Down Expand Up @@ -92,8 +93,8 @@
morekeywords=[1]{|}
}[keywords,comments,strings]

% Duplicate this definition here to avoid issue - and name it "fortran77" to avoid problem in LatexML
\lstdefinelanguage{fortran77}{%
% Duplicate this definition here to avoid issue
\lstdefinelanguage{FORTRAN77}{%
basicstyle=\upshape\smallifpdf\ttfamily, % size of fonts used for the code
morekeywords={%
ASSIGN,BACKSPACE,CALL,CHARACTER,%
Expand All @@ -114,7 +115,7 @@
LOG10,SIN,COS,TAN,ASIN,ACOS,ATAN,ATAN2,SINH,COSH,TANH,LGE,LLE,LLT,%
LEN,INDEX},
morekeywords=[4]{AND,EQ,EQV,FALSE,GE,GT,OR,LE,LT,NE,NEQV,NOT,TRUE},%
sensitive=f, % not Fortran-77 standard, but allowed in Fortran-95 %%
sensitive=true,
morecomment=[f]*,
morecomment=[f]C,
morecomment=[f]c,
Expand All @@ -130,7 +131,7 @@
short,signed,sizeof,static,struct,switch,typedef,union,unsigned,%
void,volatile,while},
% henrikt-ma: How about adding some highlighting of 'size_t' as a recognized name?
sensitive,
sensitive=true,
morecomment=[s]{/*}{*/},
morecomment=[l]//, % nonstandard
morestring=[b]",
Expand Down

0 comments on commit feb3bc8

Please sign in to comment.