Skip to content

Commit

Permalink
Fix some formatting in scoping.tex
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Aug 12, 2021
1 parent a80e290 commit 7022057
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions chapters/scoping.tex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ \section{Enclosing Classes}\label{enclosing-classes}
a partially flattened class.

\begin{nonnormative}
For example, this means that a declaration can refer to a name inherited through an extends-clause.
For example, this means that a declaration can refer to a name inherited through an \lstinline!extends!-clause.
\end{nonnormative}

\begin{example}
Expand Down Expand Up @@ -78,9 +78,10 @@ \subsection{Simple Name Lookup}\label{simple-name-lookup}
\item
Among declared named elements (\lstinline!class-definition! and \lstinline!component-declaration!) of the class (including elements inherited from base classes).
\item
Among the import names of qualified import-clauses in the \emph{instance} scope. The import name of \lstinline!import A.B.C!; is \lstinline!C! and the import name of \lstinline!import D=A.B.C;! is \lstinline!D!.
Among the import names of qualified \lstinline!import!-clauses in the \emph{instance} scope.
The import name of \lstinline!import A.B.C!; is \lstinline!C! and the import name of \lstinline!import D=A.B.C;! is \lstinline!D!.
\item
Among the public members of packages imported via unqualified import-clauses in the \emph{instance} scope. It is an error if this step produces matches from several unqualified imports.
Among the public members of packages imported via unqualified \lstinline!import!-clauses in the \emph{instance} scope. It is an error if this step produces matches from several unqualified imports.
\end{itemize}

The \lstinline!import!-clauses defined in inherited classes are ignored for the lookup, i.e.\ \lstinline!import!-clauses are not inherited.
Expand Down Expand Up @@ -112,7 +113,7 @@ \subsection{Composite Name Lookup}\label{composite-name-lookup}
\end{itemize}

\begin{nonnormative}
The temporary class flattening performed for composite names follow the same rules as class flattening of the base class in an extends-clause, local classes and the type in a \lstinline[language=grammar]!component-clause!, except that the environment is empty.
The temporary class flattening performed for composite names follow the same rules as class flattening of the base class in an \lstinline!extends!-clause, local classes and the type in a \lstinline[language=grammar]!component-clause!, except that the environment is empty.
See also \lstinline!MoistAir2! example in \cref{redeclaration} for further explanations regarding looking inside partial packages.
\end{nonnormative}
\begin{example}
Expand Down Expand Up @@ -140,7 +141,7 @@ \subsection{Global Name Lookup}\label{global-name-lookup}
\begin{itemize}
\item
The first identifier (\lstinline!A!) is looked up in the global scope.
This is possible even if the class is encapsulated\indexinline{encapsulated} and import-clauses are not used for this.
This is possible even if the class is encapsulated\indexinline{encapsulated} and \lstinline!import!-clauses are not used for this.
If there does not exist a class \lstinline!A! in global scope this is an error.
\item
If the name is simple then the class \lstinline!A! is the result of lookup.
Expand Down Expand Up @@ -517,13 +518,10 @@ \subsubsection{Steps of Instantiation}\label{steps-of-instantiation}

Classes of \lstinline!extends!-clauses of the current class are looked up in the instance tree, modifiers (including redeclarations) are merged, the contents of these classes are partially instantiated using the new modification environment, and are inserted into an \lstinline!extends!-clause node, which is an unnamed node in the current instance that only contains the inherited contents from that base class.

The classes of extends-clauses are looked up before and after handling
extends-clauses; and it is an error if those lookups generate different
results.
The classes of \lstinline!extends!-clauses are looked up before and after handling \lstinline!extends!-clauses; and it is an error if those lookups generate different results.

At the end, the current instance is checked whether their children
(including children of extends-clauses) with the same name are identical
and only the first one of them is kept. It is an error if they are not identical.
At the end, the current instance is checked whether their children (including children of \lstinline!extends!-clauses) with the same name are identical and only the first one of them is kept.
It is an error if they are not identical.

\begin{nonnormative}
Only keeping the first among the children with the same name is important for function arguments where the order matters.
Expand Down Expand Up @@ -645,7 +643,7 @@ \subsection{Generation of the flat equation system}\label{generation-of-the-flat
\end{nonnormative}

The flat equation system consists of a list of variables with dimensions, flattened equations and algorithms, and a list of called functions which are flattened separately.
A flattened function consists of algorithm or external-clause and top-level variables (variables directly declared in the function or one of its base classes) -- which recursively can contain other variables; the list of non-top-level variables is not needed.
A flattened function consists of an algorithm or \lstinline!external!-clause and top-level variables (variables directly declared in the function or one of its base classes) -- which recursively can contain other variables; the list of non-top-level variables is not needed.

The instance tree is recursively walked through as follows for elements
of the class (if necessary a partially instantiated component is first
Expand Down Expand Up @@ -698,8 +696,7 @@ \subsection{Generation of the flat equation system}\label{generation-of-the-flat
\item
Instances of local classes are ignored.
\item
The unnamed nodes corresponding to extends-clauses are recursively
handled.
The unnamed nodes corresponding to \lstinline!extends!-clauses are recursively handled.
\item
If there are function calls encountered during this process, the call
is filled up with default arguments as defined in \cref{positional-or-named-input-arguments-of-functions}. These are
Expand Down

0 comments on commit 7022057

Please sign in to comment.