Skip to content

Commit cb52ab6

Browse files
committed
python: address review comments
The comment about `py_scopes` was simply removed
1 parent e28669e commit cb52ab6

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

python/ql/lib/semmle/python/AstExtended.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ library class StrListParent extends StrListParent_ { }
8383
library class ExprParent extends ExprParent_ { }
8484

8585
/** Internal implementation class */
86-
library class PatternListParent extends PatternListParent_ { }
86+
class PatternListParent extends PatternListParent_ { }
8787

8888
/** Internal implementation class */
8989
library class PatternParent extends PatternParent_ { }

python/ql/lib/semmle/python/Patterns.qll

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ import python
77
/** A pattern in a match statement */
88
class Pattern extends Pattern_, AstNode {
99
/** Gets the scope of this pattern */
10-
override Scope getScope() {
11-
// TODO: Should it be defined as
12-
// py_scopes(this, result)
13-
// instead?
14-
result = this.getCase().getScope()
15-
}
10+
override Scope getScope() { result = this.getCase().getScope() }
1611

1712
/** Gets the case statement containing this pattern */
1813
Case getCase() { result.contains(this) }

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPrivate.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,8 +1590,8 @@ import IterableUnpacking
15901590
* case ('quit' as c) | ('go', ('up'|'down') as c):
15911591
* ...body
15921592
* ```
1593-
* `command` is the subject of the as-pattern, while the second component of `command` is the subject
1594-
* of the first capture pattern. As such, 'subject' refers to the pattern under evaluation.
1593+
* `command` is the subject of first the as-pattern, while the second component of `command`
1594+
* is the subject of the second as-pattern. As such, 'subject' refers to the pattern under evaluation.
15951595
*
15961596
* - as pattern: subject flows to alias as well as to the interior pattern
15971597
* - or pattern: subject flows to each alternative

0 commit comments

Comments
 (0)