Skip to content

Commit b85ab3c

Browse files
authored
Merge pull request #20490 from github/ginsbach/AdditionalAndExtensible
documentation: add some missing mentions of `additional` and `extensible`
2 parents 2cd1d2f + b27d374 commit b85ab3c

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ For example, to declare a module ``M`` as private, you could use:
1616
}
1717
1818
Note that some annotations act on an entity itself, whilst others act on a particular *name* for the entity:
19-
- Act on an **entity**: ``abstract``, ``cached``, ``external``, ``transient``, ``override``, ``pragma``, ``language``,
20-
and ``bindingset``
21-
- Act on a **name**: ``deprecated``, ``library``, ``private``, ``final``, and ``query``
19+
- Act on an **entity**: ``abstract``, ``bindingset``, ``cached``, ``extensible``, ``external``, ``language``,
20+
``override``, ``pragma``, and ``transient``
21+
- Act on a **name**: ``additional``, ``deprecated``, ``final``, ``library``, ``private``, and ``query``
2222

2323
For example, if you annotate an entity with ``private``, then only that particular name is
2424
private. You could still access that entity under a different name (using an :ref:`alias <aliases>`).

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

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -761,17 +761,17 @@ Various kinds of syntax can have *annotations* applied to them. Annotations are
761761
annotation ::= simpleAnnotation | argsAnnotation
762762

763763
simpleAnnotation ::= "abstract"
764+
| "additional"
764765
| "cached"
765-
| "external"
766+
| "deprecated"
766767
| "extensible"
768+
| "external"
767769
| "final"
768-
| "transient"
769770
| "library"
770-
| "private"
771-
| "deprecated"
772771
| "override"
773-
| "additional"
772+
| "private"
774773
| "query"
774+
| "transient"
775775

776776
argsAnnotation ::= "pragma" "[" ("inline" | "inline_late" | "noinline" | "nomagic" | "noopt" | "assume_small_delta") "]"
777777
| "language" "[" "monotonicAggregates" "]"
@@ -791,28 +791,28 @@ The following table summarizes the syntactic constructs which can be marked with
791791
+================+=========+============+===================+=======================+=========+========+=========+=========+============+
792792
| ``abstract`` | yes | | yes | | | | | | |
793793
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
794+
| ``additional`` | yes | | | yes | | | yes | yes | yes |
795+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
794796
| ``cached`` | yes | yes | yes | yes | | | yes | | |
795797
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
796-
| ``external`` | | | | yes | | | | | |
798+
| ``deprecated`` | yes | | yes | yes | yes | yes | yes | yes | yes |
797799
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
798800
| ``extensible`` | | | | yes | | | | | |
799801
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
800-
| ``final`` | yes | | yes | | | yes | | (yes) | |
802+
| ``external`` | | | | yes | | | | | |
801803
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
802-
| ``transient`` | | | | yes | | | | | |
804+
| ``final`` | yes | | yes | | | yes | | (yes) | |
803805
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
804806
| ``library`` | (yes) | | | | | | | | |
805807
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
806-
| ``private`` | yes | | yes | yes | yes | yes | yes | yes | yes |
807-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
808-
| ``deprecated`` | yes | | yes | yes | yes | yes | yes | yes | yes |
809-
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
810808
| ``override`` | | | yes | | | yes | | | |
811809
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
812-
| ``additional`` | yes | | | yes | | | yes | yes | yes |
810+
| ``private`` | yes | | yes | yes | yes | yes | yes | yes | yes |
813811
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
814812
| ``query`` | | | | yes | | | | yes | |
815813
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
814+
| ``transient`` | | | | yes | | | | | |
815+
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
816816

817817
The ``library`` annotation is only usable within a QLL file, not a QL file.
818818
The ``final`` annotation is usable on type aliases, but not on module aliases and predicate aliases.
@@ -933,7 +933,8 @@ A predicate definition adds a mapping from the predicate name and arity to the p
933933

934934
When a predicate is a top-level clause in a module, it is called a non-member predicate. See below for "`Member predicates <#member-predicates>`__."
935935

936-
A valid non-member predicate can be annotated with ``cached``, ``deprecated``, ``external``, ``transient``, ``private``, and ``query``. Note, the ``transient`` annotation can only be applied if the non-member predicate is also annotated with ``external``.
936+
A valid non-member predicate can be annotated with ``additional``, ``cached``, ``deprecated``, ``extensible``, ``external``, ``transient``, ``private``, and ``query``.
937+
Note, the ``transient`` annotation can only be applied if the non-member predicate is also annotated with ``external``.
937938

938939
The head of the predicate gives a name, an optional *result type*, and a sequence of variables declarations that are *arguments*:
939940

@@ -979,7 +980,7 @@ A class type is said to *final inherit* from base types that are final or refere
979980

980981
A class adds a mapping from the class name to the class declaration to the current module's declared type environment.
981982

982-
A valid class can be annotated with ``abstract``, ``final``, ``library``, and ``private``. Any other annotation renders the class invalid.
983+
A valid class can be annotated with ``abstract``, ``additional``, ``final``, ``library``, and ``private``. Any other annotation renders the class invalid.
983984

984985
A valid class may not inherit from itself, or from more than one primitive type. The set of types that a valid class inherits from must be disjoint from the set of types that it final inherits from.
985986

@@ -2292,17 +2293,17 @@ The complete grammar for QL is as follows:
22922293
annotation ::= simpleAnnotation | argsAnnotation
22932294

22942295
simpleAnnotation ::= "abstract"
2296+
| "additional"
22952297
| "cached"
2296-
| "external"
2298+
| "deprecated"
22972299
| "extensible"
2300+
| "external"
22982301
| "final"
2299-
| "transient"
23002302
| "library"
2301-
| "private"
2302-
| "deprecated"
23032303
| "override"
2304-
| "additional"
2304+
| "private"
23052305
| "query"
2306+
| "transient"
23062307

23072308
argsAnnotation ::= "pragma" "[" ("inline" | "inline_late" | "noinline" | "nomagic" | "noopt" | "assume_small_delta") "]"
23082309
| "language" "[" "monotonicAggregates" "]"

0 commit comments

Comments
 (0)