You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/codeql/ql-language-reference/ql-language-specification.rst
+21-6Lines changed: 21 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,17 +133,32 @@ The program is invalid if any of these environments is not definite.
133
133
Module environments
134
134
~~~~~~~~~~~~~~~~~~~
135
135
136
-
For each of modules, types, and predicates, a module *imports*, *declares*, and *exports* an environment. These are defined as follows (with X denoting the type of entity we are currently considering):
136
+
For each of modules, types, predicates, module signatures, type signatures, and predicates signatures, we distinguish five environments: *publically declared*, *privately declared*, *exported*, and *visible*.
137
+
These are defined as follows (with X denoting the type of entity we are currently considering):
137
138
138
-
- The *imported X environment* of a module is defined to be the union of the exported X environments of all the modules which the current module directly imports (see "`Import directives <#import-directives>`__").
139
+
- The *privately declared X environment* of a module is the multimap of X declarations and aliases in the module itself that are annotated as ``private``.
139
140
140
-
- The *declared X environment* of a module is the multimap of X declarations in the module itself.
141
+
- The *publically declared X environment* of a module is the multimap of X declarations and aliases in the module itself that are not annotated as ``private``.
141
142
142
-
- The *exported X environment* of a module is the union of the exported X environments of the modules which the current module directly imports (excluding ``private`` imports), and the declared X environment of the current module (excluding ``private`` declarations).
143
+
- The *exported X environment* of a module is the union of
143
144
144
-
- The *external X environment* of a module is the visible X environment of the enclosing module, if there is one, and otherwise the global X environment.
145
+
1. its *publically declared X environment*, and
145
146
146
-
- The *visible X environment* is the union of the imported X environment, the declared X environment, and the external X environment.
147
+
2. for each module which the current module directly imports (excluding ``private`` imports - see "`Import directives <#import-directives>`__"): all entries from the *exported X environment* that have a key not present in the *publically declared X environment* of the current module.
148
+
149
+
- The *visible X environment* of a module is the union of
150
+
151
+
1. its *exported X environment*, and
152
+
153
+
2. its *privately declared X environment*, and
154
+
155
+
3. the *global X environment*, and
156
+
157
+
4. for each module which the current module privately imports: all entries from the *exported X environment* that have a key not present in the *publically declared X environment* of the current module, and
158
+
159
+
5. if there is an enclosing module: all entries from the *visible X environment* of the enclosing module that have a key not present in the *publically declared X environment* of the current module, and
160
+
161
+
6. all parameters of the current module that are of type X.
147
162
148
163
The program is invalid if any of these environments is not definite.
0 commit comments