Skip to content

Commit 71a6e62

Browse files
authored
Merge pull request github#13264 from github/ginsbach/MoveSignaturesSection
move section on signatures in the QL specification
2 parents 1179f20 + 3e7389e commit 71a6e62

File tree

1 file changed

+32
-35
lines changed

1 file changed

+32
-35
lines changed

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

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -334,40 +334,6 @@ Active types
334334

335335
In a QL program, the *active* types are those defined in active modules. In the remainder of this specification, any reference to the types in the program refers only to the active types.
336336

337-
338-
Signatures
339-
----------
340-
341-
Signature definitions
342-
~~~~~~~~~~~~~~~~~~~~~
343-
344-
A QL signature definition has the following syntax:
345-
346-
::
347-
348-
signature ::= predicateSignature | typeSignature | moduleSignature
349-
350-
predicateSignature ::= qldoc? annotations "signature" head ";"
351-
352-
typeSignature ::= qldoc? annotations "signature" "class" classname ("extends" type ("," type)*)? (";" | "{" signaturePredicate* "}")
353-
354-
moduleSignature ::= qldoc? annotation* "signature" "module" moduleSignatureName parameters? "{" moduleSignatureBody "}"
355-
356-
moduleSignatureBody ::= (signaturePredicate | defaultPredicate | signatureType)*
357-
358-
signaturePredicate ::= qldoc? annotations head ";"
359-
360-
defaultPredicate ::= qldoc? annotations "default" head "{" formula "}"
361-
362-
signatureType ::= qldoc? annotations "class" classname ("extends" type ("," type)*)? "{" signaturePredicate* "}"
363-
364-
365-
A predicate signature definition extends the current module's declared predicate signature environment with a mapping from the predicate signature name and arity to the predicate signature definition.
366-
367-
A type signature definition extends the current module's declared type signature environment with a mapping from the type signature name to the type signature definition.
368-
369-
A module signature definition extends the current module's declared module signature environment with a mapping from the module signature name to the module signature definition.
370-
371337
Values
372338
------
373339

@@ -859,7 +825,7 @@ If the query file starts with whitespace followed by a QLDoc comment, then the t
859825
Top-level entities
860826
------------------
861827

862-
Modules include five kinds of top-level entity: predicates, classes, modules, aliases, and select clauses.
828+
Modules include five kinds of top-level entity: predicates, classes, modules, aliases, signatures, and select clauses.
863829

864830
Non-member predicates
865831
~~~~~~~~~~~~~~~~~~~~~
@@ -1013,6 +979,37 @@ A valid field must override another field if it is annotated ``override``.
1013979

1014980
When field ``f`` overrides field ``g`` the type of ``f`` must be a subtype of the type of ``g``. ``f`` may not be a final field.
1015981

982+
983+
Signatures
984+
~~~~~~~~~~
985+
986+
A signature definition has the following syntax:
987+
988+
::
989+
990+
signature ::= predicateSignature | typeSignature | moduleSignature
991+
992+
predicateSignature ::= qldoc? annotations "signature" head ";"
993+
994+
typeSignature ::= qldoc? annotations "signature" "class" classname ("extends" type ("," type)*)? (";" | "{" signaturePredicate* "}")
995+
996+
moduleSignature ::= qldoc? annotation* "signature" "module" moduleSignatureName parameters? "{" moduleSignatureBody "}"
997+
998+
moduleSignatureBody ::= (signaturePredicate | defaultPredicate | signatureType)*
999+
1000+
signaturePredicate ::= qldoc? annotations head ";"
1001+
1002+
defaultPredicate ::= qldoc? annotations "default" head "{" formula "}"
1003+
1004+
signatureType ::= qldoc? annotations "class" classname ("extends" type ("," type)*)? "{" signaturePredicate* "}"
1005+
1006+
1007+
A predicate signature definition extends the current module's declared predicate signature environment with a mapping from the predicate signature name and arity to the predicate signature definition.
1008+
1009+
A type signature definition extends the current module's declared type signature environment with a mapping from the type signature name to the type signature definition.
1010+
1011+
A module signature definition extends the current module's declared module signature environment with a mapping from the module signature name to the module signature definition.
1012+
10161013
Select clauses
10171014
~~~~~~~~~~~~~~
10181015

0 commit comments

Comments
 (0)