Skip to content

Commit 861377f

Browse files
committed
Swift: property doc tweaks
1 parent 65fd9cb commit 861377f

File tree

115 files changed

+245
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+245
-254
lines changed

swift/codegen/templates/ql_class.mustache

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ module Generated {
5959

6060
{{#type_is_class}}
6161
/**
62-
* Gets the {{#is_repeated}}`index`th {{/is_repeated}}{{doc_name}}{{#is_optional}}, if it exists{{/is_optional}}.
63-
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
62+
* {{>ql_property_doc}} * This includes nodes from the "hidden" AST and can be used to be overridden by subclasses.
6463
*/
6564
{{type}} getImmediate{{singular}}({{#is_repeated}}int index{{/is_repeated}}) {
6665
{{^ipa}}
@@ -72,11 +71,7 @@ module Generated {
7271
}
7372

7473
/**
75-
* Gets the {{#is_repeated}}`index`th {{/is_repeated}}{{doc_name}}{{#is_optional}}, if it exists{{/is_optional}}.
76-
{{#has_doc}}
77-
*
78-
{{#doc}}
79-
* {{.}}
74+
* {{>ql_property_doc}}{{#has_doc}}{{#doc}} * {{.}}
8075
{{/doc}}
8176
{{/has_doc}}
8277
*/
@@ -88,11 +83,7 @@ module Generated {
8883
{{^type_is_class}}
8984
{{^is_predicate}}
9085
/**
91-
* Gets the {{#is_repeated}}`index`th {{/is_repeated}}{{doc_name}}{{#is_optional}}, if it exists{{/is_optional}}.
92-
{{#has_doc}}
93-
*
94-
{{#doc}}
95-
* {{.}}
86+
* {{>ql_property_doc}}{{#has_doc}}{{#doc}} * {{.}}
9687
{{/doc}}
9788
{{/has_doc}}
9889
*/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Gets the {{#is_repeated}}`index`th {{/is_repeated}}{{doc_name}}{{#is_repeated}} (0-based){{/is_repeated}}{{#is_optional}}, if it exists{{/is_optional}}.

swift/ql/lib/codeql/swift/generated/Callable.qll

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Generated {
99
class Callable extends Synth::TCallable, Element {
1010
/**
1111
* Gets the self param, if it exists.
12-
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
12+
* This includes nodes from the "hidden" AST and can be used to be overridden by subclasses.
1313
*/
1414
ParamDecl getImmediateSelfParam() {
1515
result =
@@ -29,8 +29,8 @@ module Generated {
2929
final predicate hasSelfParam() { exists(getSelfParam()) }
3030

3131
/**
32-
* Gets the `index`th param.
33-
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
32+
* Gets the `index`th param (0-based).
33+
* This includes nodes from the "hidden" AST and can be used to be overridden by subclasses.
3434
*/
3535
ParamDecl getImmediateParam(int index) {
3636
result =
@@ -40,7 +40,7 @@ module Generated {
4040
}
4141

4242
/**
43-
* Gets the `index`th param.
43+
* Gets the `index`th param (0-based).
4444
*/
4545
final ParamDecl getParam(int index) { result = getImmediateParam(index).resolve() }
4646

@@ -56,7 +56,7 @@ module Generated {
5656

5757
/**
5858
* Gets the body, if it exists.
59-
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
59+
* This includes nodes from the "hidden" AST and can be used to be overridden by subclasses.
6060
*/
6161
BraceStmt getImmediateBody() {
6262
result =
@@ -65,7 +65,6 @@ module Generated {
6565

6666
/**
6767
* Gets the body, if it exists.
68-
*
6968
* The body is absent within protocol declarations.
7069
*/
7170
final BraceStmt getBody() { result = getImmediateBody().resolve() }

swift/ql/lib/codeql/swift/generated/Locatable.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Generated {
88
class Locatable extends Synth::TLocatable, Element {
99
/**
1010
* Gets the location, if it exists.
11-
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
11+
* This includes nodes from the "hidden" AST and can be used to be overridden by subclasses.
1212
*/
1313
Location getImmediateLocation() {
1414
result =

swift/ql/lib/codeql/swift/generated/Location.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Generated {
88
class Location extends Synth::TLocation, Element {
99
/**
1010
* Gets the file.
11-
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
11+
* This includes nodes from the "hidden" AST and can be used to be overridden by subclasses.
1212
*/
1313
File getImmediateFile() {
1414
result =

swift/ql/lib/codeql/swift/generated/decl/AbstractStorageDecl.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import codeql.swift.elements.decl.ValueDecl
77
module Generated {
88
class AbstractStorageDecl extends Synth::TAbstractStorageDecl, ValueDecl {
99
/**
10-
* Gets the `index`th accessor decl.
11-
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
10+
* Gets the `index`th accessor decl (0-based).
11+
* This includes nodes from the "hidden" AST and can be used to be overridden by subclasses.
1212
*/
1313
AccessorDecl getImmediateAccessorDecl(int index) {
1414
result =
@@ -18,7 +18,7 @@ module Generated {
1818
}
1919

2020
/**
21-
* Gets the `index`th accessor decl.
21+
* Gets the `index`th accessor decl (0-based).
2222
*/
2323
final AccessorDecl getAccessorDecl(int index) {
2424
result = getImmediateAccessorDecl(index).resolve()

swift/ql/lib/codeql/swift/generated/decl/Decl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Generated {
88
class Decl extends Synth::TDecl, AstNode {
99
/**
1010
* Gets the module.
11-
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
11+
* This includes nodes from the "hidden" AST and can be used to be overridden by subclasses.
1212
*/
1313
ModuleDecl getImmediateModule() {
1414
result =

swift/ql/lib/codeql/swift/generated/decl/EnumCaseDecl.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ module Generated {
99
override string getAPrimaryQlClass() { result = "EnumCaseDecl" }
1010

1111
/**
12-
* Gets the `index`th element.
13-
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
12+
* Gets the `index`th element (0-based).
13+
* This includes nodes from the "hidden" AST and can be used to be overridden by subclasses.
1414
*/
1515
EnumElementDecl getImmediateElement(int index) {
1616
result =
@@ -20,7 +20,7 @@ module Generated {
2020
}
2121

2222
/**
23-
* Gets the `index`th element.
23+
* Gets the `index`th element (0-based).
2424
*/
2525
final EnumElementDecl getElement(int index) { result = getImmediateElement(index).resolve() }
2626

swift/ql/lib/codeql/swift/generated/decl/EnumElementDecl.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ module Generated {
1616
}
1717

1818
/**
19-
* Gets the `index`th param.
20-
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
19+
* Gets the `index`th param (0-based).
20+
* This includes nodes from the "hidden" AST and can be used to be overridden by subclasses.
2121
*/
2222
ParamDecl getImmediateParam(int index) {
2323
result =
@@ -27,7 +27,7 @@ module Generated {
2727
}
2828

2929
/**
30-
* Gets the `index`th param.
30+
* Gets the `index`th param (0-based).
3131
*/
3232
final ParamDecl getParam(int index) { result = getImmediateParam(index).resolve() }
3333

swift/ql/lib/codeql/swift/generated/decl/ExtensionDecl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Generated {
1212

1313
/**
1414
* Gets the extended type decl.
15-
* This is taken from the "hidden" AST and should only be used to be overridden by classes.
15+
* This includes nodes from the "hidden" AST and can be used to be overridden by subclasses.
1616
*/
1717
NominalTypeDecl getImmediateExtendedTypeDecl() {
1818
result =

0 commit comments

Comments
 (0)