Skip to content

Commit

Permalink
Align formatting of grammar listings
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Aug 11, 2021
1 parent d2e400d commit 0896281
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
16 changes: 9 additions & 7 deletions chapters/equations.tex
Expand Up @@ -92,8 +92,8 @@ \subsection{For-Equations -- Repetitive Equation Structures}\label{for-equations
The syntax of a \lstinline!for!-equation\index{for@\robustinline{for}!equation}\index{loop@\robustinline{loop}!for-equation@\robustinline{for}-equation} is as follows:
\begin{lstlisting}[language=grammar]
for for-indices loop
{ equation ";" }
end for ";"
{ equation ";" }
end for ";"
\end{lstlisting}

A \lstinline!for!-equation may optionally use several iterators (\lstinline[language=grammar]!for-indices!)\index{in@\robustinline{in}!for-equation@\robustinline{for}-equation}, see \cref{nested-for-loops-and-reduction-expressions-with-multiple-iterators} for more information:
Expand Down Expand Up @@ -171,11 +171,12 @@ \subsection{If-Equations}\label{if-equations}
The \lstinline!if!-equations\index{if@\robustinline{if}!equation}\index{then@\robustinline{then}!if-equation@\robustinline{if}-equation}\index{else@\robustinline{else}!if-equation@\robustinline{if}-equation}\index{elseif@\robustinline{elseif}!if-equation@\robustinline{if}-equation} have the following syntax:
\begin{lstlisting}[language=grammar]
if expression then
{ equation ";" }
{ equation ";" }
{ elseif expression then
{ equation ";" } }
{ equation ";" }
}
[ else
{ equation ";" }
{ equation ";" }
]
end if ";"
\end{lstlisting}
Expand All @@ -199,9 +200,10 @@ \subsection{When-Equations}\label{when-equations}
The \lstinline!when!-equations\index{when@\robustinline{when}!equation}\index{then@\robustinline{then}!when-equation@\robustinline{when}-equation}\index{elsewhen@\robustinline{elsewhen}!when-equation@\robustinline{when}-equation} have the following syntax:
\begin{lstlisting}[language=grammar]
when expression then
{ equation ";" }
{ equation ";" }
{ elsewhen expression then
{ equation ";" } }
{ equation ";" }
}
end when ";"
\end{lstlisting}

Expand Down
17 changes: 9 additions & 8 deletions chapters/statements.tex
Expand Up @@ -349,12 +349,12 @@ \subsection{If-Statement}\label{if-statement}
\begin{lstlisting}[language=grammar]
if expression then
{ statement ";" }
{ elseif expression then
{ statement ";" }
}
[ else
{ statement ";" }
]
{ elseif expression then
{ statement ";" }
}
[ else
{ statement ";" }
]
end if;
\end{lstlisting}

Expand All @@ -371,8 +371,9 @@ \subsection{When-Statements}\label{when-statements}
\begin{lstlisting}[language=grammar]
when expression then
{ statement ";" }
{ elsewhen expression then
{ statement ";" } }
{ elsewhen expression then
{ statement ";" }
}
end when
\end{lstlisting}

Expand Down
2 changes: 1 addition & 1 deletion chapters/syntax.tex
Expand Up @@ -317,7 +317,7 @@ \subsection{Equations}\label{equations1}

while-statement :
while expression loop
{ statement ";" }
{ statement ";" }
end while

when-equation :
Expand Down

0 comments on commit 0896281

Please sign in to comment.