Skip to content

Commit 1ed3bae

Browse files
committed
mention instantiation in the section on module resolution
1 parent 45426b9 commit 1ed3bae

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

docs/codeql/ql-language-reference/ql-language-specification.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,17 @@ A query module must contain one or more queries.
219219
Import directives
220220
~~~~~~~~~~~~~~~~~
221221

222-
An import directive refers to a module identifier:
222+
An import directive refers to a module expression:
223223

224224
::
225225

226226
import ::= annotations "import" importModuleExpr ("as" modulename)?
227227

228-
qualId ::= simpleId | qualId "." simpleId
228+
importModuleExpr ::= importModuleId arguments?
229229

230-
importModuleExpr ::= qualId | importModuleExpr "::" modulename arguments?
230+
importModuleId ::= qualId | importModuleExpr "::" modulename
231+
232+
qualId ::= simpleId | qualId "." simpleId
231233

232234
arguments ::= "<" argument ("," argument)* ">"
233235

@@ -260,6 +262,10 @@ For qualified identifiers (``a.b``):
260262

261263
A qualified module identifier is only valid within an import.
262264

265+
Module expressions contain a module identifier and optional arguments. If arguments are present, the module expression instantiates the module that the identifier resolves to (see :ref:`Parameterized modules`).
266+
267+
Module expressions cannot refer to :ref:`Parameterized modules`. Instead, parameterized modules must always be fully instantiated when they are referenced.
268+
263269
.. _Parameterized modules:
264270

265271
Parameterized modules
@@ -361,7 +367,9 @@ With the exception of class domain types and character types (which cannot be re
361367

362368
type ::= (moduleExpr "::")? classname | dbasetype | "boolean" | "date" | "float" | "int" | "string"
363369

364-
moduleExpr ::= modulename arguments? | moduleExpr "::" modulename arguments?
370+
moduleExpr ::= moduleId arguments?
371+
372+
moduleId ::= modulename | moduleExpr "::" modulename
365373

366374
A type reference is resolved to a type as follows:
367375

0 commit comments

Comments
 (0)