Skip to content

Commit e18cf08

Browse files
committed
documentation changes based on review
1 parent c1dba2e commit e18cf08

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

python/ql/src/semmle/python/PrintAst.qll

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class PrintAstConfiguration extends TPrintAstConfiguration {
2020
string toString() { result = "PrintAstConfiguration" }
2121

2222
/**
23-
* Controls whether the `Element` should be considered for AST printing.
24-
* By default it checks whether the `Element` `e` belongs to `Location` `l`.
23+
* Controls whether the `AstNode` should be considered for AST printing.
24+
* By default it checks whether the `AstNode` `e` belongs to `Location` `l`.
2525
*/
2626
predicate shouldPrint(AstNode e, Location l) { l = e.getLocation() }
2727
}
@@ -132,9 +132,9 @@ class TopLevelPrintAstNode extends PrintAstNode {
132132
/**
133133
* An `AstNode` printed in the print-viewer.
134134
*
135-
* This class can be overwriten to define more specific behavior for some `AstNode`s.
136-
* The `getChildNode` and `getStmtList` methods can be overwritten to easily set up a child-parent relation between different `AstElementNode`s.
137-
* Be very carefull about overriding `getChild`, as `getChildNode` and `getStmtList` depends on the default beavior of `getChild`.
135+
* This class can be overridden to define more specific behavior for some `AstNode`s.
136+
* The `getChildNode` and `getStmtList` methods can be overridden to easily set up a child-parent relation between different `AstElementNode`s.
137+
* Be very careful about overriding `getChild`, as `getChildNode` and `getStmtList` depend on the default behavior of `getChild`.
138138
*/
139139
class AstElementNode extends PrintAstNode, TElementNode {
140140
AstNode element;
@@ -276,8 +276,8 @@ class WhilePrintNode extends AstElementNode {
276276

277277
/**
278278
* A print node for `StmtList`.
279-
* A `StmtListNode` is always a child of a `AstElementNode`,
280-
* and the child-parent relation is decided by the `getStmtList` predicate in `AstElementNode.
279+
* A `StmtListNode` is always a child of an `AstElementNode`,
280+
* and the child-parent relation is defined by the `getStmtList` predicate in `AstElementNode`.
281281
*
282282
* The label for a `StmtList` is decided based on the result from the `getStmtList` predicate in `AstElementNode`.
283283
*/
@@ -440,7 +440,7 @@ private AstNode getChild(AstNode node, int i) {
440440
*/
441441
private module PrettyPrinting {
442442
/**
443-
* Gets the QL class for `a`.
443+
* Gets the QL class for the `AstNode` `a`.
444444
* Most `AstNode`s print their QL class in the `toString()` method, however there are exceptions.
445445
* These exceptions are handled in the `getQlCustomClass` predicate.
446446
*/
@@ -454,7 +454,7 @@ private module PrettyPrinting {
454454
}
455455

456456
/**
457-
* Gets the QL class for `a` for the `AstNode`s where the toString method does not print the QL class.
457+
* Gets the QL class for `AstNode`s where the `toString` method does not print the QL class.
458458
*/
459459
string getQlCustomClass(AstNode a) {
460460
shouldPrint(a, _) and
@@ -481,7 +481,7 @@ private module PrettyPrinting {
481481
/**
482482
* Gets a human-readable representation of the `AstNode` `a`, or the empty string.
483483
*
484-
* Has one and only result for every AstNode.
484+
* Has exactly one result for every `AstNode`.
485485
*/
486486
string prettyPrint(AstNode a) {
487487
shouldPrint(a, _) and
@@ -572,7 +572,7 @@ private module PrettyPrinting {
572572

573573
/**
574574
* Gets a human-readable representation of the given `AstNode`.
575-
* Is only defined for the an `AstNode` where a human-readable representation can be created without using recursion.
575+
* Is only defined for `AstNode`s for which a human-readable representation can be created without using recursion.
576576
*/
577577
private string reprBase(AstNode a) {
578578
shouldPrint(a, _) and

0 commit comments

Comments
 (0)