Skip to content

Commit 989b57c

Browse files
authored
Merge pull request github#3822 from tausbn/python-document-internal-ast-classes
Python: Document internal AST classes.
2 parents 4a5299e + 7e97bd1 commit 989b57c

27 files changed

+234
-2
lines changed

python/ql/src/Lexical/CommentedOutCode.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ class CommentedOutCodeLine extends Comment {
175175
class CommentedOutCodeBlock extends @py_comment {
176176
CommentedOutCodeBlock() { commented_out_code_block(this, _) }
177177

178+
/** Gets a textual representation of this element. */
178179
string toString() { result = "Commented out code" }
179180

180181
/** Whether this commented-out code block contains the comment c */

python/ql/src/analysis/DefinitionTracking.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ private newtype TDefinition =
1010

1111
/** A definition for the purposes of jump-to-definition. */
1212
class Definition extends TLocalDefinition {
13+
/** Gets a textual representation of this element. */
1314
string toString() { result = "Definition " + this.getAstNode().getLocation().toString() }
1415

1516
AstNode getAstNode() { this = TLocalDefinition(result) }
@@ -467,6 +468,7 @@ Definition getUniqueDefinition(Expr use) {
467468

468469
/** Helper class to get suitable locations for attributes */
469470
class NiceLocationExpr extends @py_expr {
471+
/** Gets a textual representation of this element. */
470472
string toString() { result = this.(Expr).toString() }
471473
/**
472474
* Holds if this element is at the specified location.

python/ql/src/external/ExternalArtifact.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class ExternalDefect extends @externalDefect {
1818

1919
Location getLocation() { externalDefects(this, _, result, _, _) }
2020

21+
/** Gets a textual representation of this element. */
2122
string toString() { result = getQueryPath() + ": " + getLocation() + " - " + getMessage() }
2223
}
2324

@@ -28,6 +29,7 @@ class ExternalMetric extends @externalMetric {
2829

2930
Location getLocation() { externalMetrics(this, _, result, _) }
3031

32+
/** Gets a textual representation of this element. */
3133
string toString() { result = getQueryPath() + ": " + getLocation() + " - " + getValue() }
3234
}
3335

python/ql/src/external/VCS.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Commit extends @svnentry {
1010
)
1111
}
1212

13+
/** Gets a textual representation of this element. */
1314
string toString() { result = this.getRevisionName() }
1415

1516
string getRevisionName() { svnentries(this, result, _, _, _) }

0 commit comments

Comments
 (0)