Skip to content

Commit 1179f20

Browse files
authored
Merge pull request github#13263 from github/ginsbach/DocumentAnnotationsForParameterised
update QL specification on annotations for parameterised modules
2 parents 5234080 + f884473 commit 1179f20

File tree

1 file changed

+39
-28
lines changed

1 file changed

+39
-28
lines changed

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

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -704,12 +704,14 @@ Various kinds of syntax can have *annotations* applied to them. Annotations are
704704
simpleAnnotation ::= "abstract"
705705
| "cached"
706706
| "external"
707+
| "extensible"
707708
| "final"
708709
| "transient"
709710
| "library"
710711
| "private"
711712
| "deprecated"
712713
| "override"
714+
| "additional"
713715
| "query"
714716

715717
argsAnnotation ::= "pragma" "[" ("inline" | "inline_late" | "noinline" | "nomagic" | "noopt" | "assume_small_delta") "]"
@@ -725,31 +727,36 @@ Simple annotations
725727

726728
The following table summarizes the syntactic constructs which can be marked with each annotation in a valid program; for example, an ``abstract`` annotation preceding a character is invalid.
727729

728-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
729-
| Annotation | Classes | Characters | Member predicates | Non-member predicates | Imports | Fields | Modules | Aliases |
730-
+================+=========+============+===================+=======================+=========+========+=========+=========+
731-
| ``abstract`` | yes | | yes | | | | | |
732-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
733-
| ``cached`` | yes | yes | yes | yes | | | yes | |
734-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
735-
| ``external`` | | | | yes | | | | |
736-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
737-
| ``final`` | yes | | yes | | | yes | | yes |
738-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
739-
| ``transient`` | | | | yes | | | | |
740-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
741-
| ``library`` | yes | | | | | | | |
742-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
743-
| ``private`` | yes | | yes | yes | yes | yes | yes | yes |
744-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
745-
| ``deprecated`` | yes | | yes | yes | | yes | yes | yes |
746-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
747-
| ``override`` | | | yes | | | yes | | |
748-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
749-
| ``query`` | | | | yes | | | | yes |
750-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
730+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
731+
| Annotation | Classes | Characters | Member predicates | Non-member predicates | Imports | Fields | Modules | Aliases | Signatures |
732+
+================+=========+============+===================+=======================+=========+========+=========+=========+============+
733+
| ``abstract`` | yes | | yes | | | | | | |
734+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
735+
| ``cached`` | yes | yes | yes | yes | | | yes | | |
736+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
737+
| ``external`` | | | | yes | | | | | |
738+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
739+
| ``extensible`` | | | | yes | | | | | |
740+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
741+
| ``final`` | yes | | yes | | | yes | | (yes) | |
742+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
743+
| ``transient`` | | | | yes | | | | | |
744+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
745+
| ``library`` | (yes) | | | | | | | | |
746+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
747+
| ``private`` | yes | | yes | yes | yes | yes | yes | yes | yes |
748+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
749+
| ``deprecated`` | yes | | yes | yes | | yes | yes | yes | yes |
750+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
751+
| ``override`` | | | yes | | | yes | | | |
752+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
753+
| ``additional`` | yes | | | yes | | | yes | yes | yes |
754+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
755+
| ``query`` | | | | yes | | | | yes | |
756+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
751757

752758
The ``library`` annotation is only usable within a QLL file, not a QL file.
759+
The ``final`` annotation is usable on type aliases, but not on module aliases and predicate aliases.
753760

754761
Annotations on aliases apply to the name introduced by the alias. An alias may, for example, have different privacy to the name it aliases.
755762

@@ -799,11 +806,13 @@ Binding sets are checked by the QL compiler in the following way:
799806

800807
A predicate may have several different binding sets, which can be stated by using multiple ``bindingset`` annotations on the same predicate.
801808

802-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
803-
| Pragma | Classes | Characters | Member predicates | Non-member predicates | Imports | Fields | Modules | Aliases |
804-
+================+=========+============+===================+=======================+=========+========+=========+=========+
805-
| ``bindingset`` | | yes | yes | yes | | | | |
806-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
809+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
810+
| Pragma | Classes | Characters | Member predicates | Non-member predicates | Imports | Fields | Modules | Aliases | Signatures |
811+
+================+=========+============+===================+=======================+=========+========+=========+=========+============+
812+
| ``bindingset`` | | yes | yes | yes | | | | | (yes) |
813+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
814+
815+
The ``bindingset`` pragma is usable with type signatures and predicate signatures, but not with module signatures.
807816

808817
QLDoc
809818
-----
@@ -2159,12 +2168,14 @@ The complete grammar for QL is as follows:
21592168
simpleAnnotation ::= "abstract"
21602169
| "cached"
21612170
| "external"
2171+
| "extensible"
21622172
| "final"
21632173
| "transient"
21642174
| "library"
21652175
| "private"
21662176
| "deprecated"
21672177
| "override"
2178+
| "additional"
21682179
| "query"
21692180

21702181
argsAnnotation ::= "pragma" "[" ("inline" | "inline_late" | "noinline" | "nomagic" | "noopt" | "assume_small_delta") "]"

0 commit comments

Comments
 (0)