python: address review comments

The comment about `py_scopes` was simply removed
This commit is contained in:
Rasmus Lerchedahl Petersen
2022-01-27 11:17:00 +01:00
parent e28669e487
commit cb52ab669e
3 changed files with 4 additions and 9 deletions

View File

@@ -83,7 +83,7 @@ library class StrListParent extends StrListParent_ { }
library class ExprParent extends ExprParent_ { }
/** Internal implementation class */
library class PatternListParent extends PatternListParent_ { }
class PatternListParent extends PatternListParent_ { }
/** Internal implementation class */
library class PatternParent extends PatternParent_ { }

View File

@@ -7,12 +7,7 @@ import python
/** A pattern in a match statement */
class Pattern extends Pattern_, AstNode {
/** Gets the scope of this pattern */
override Scope getScope() {
// TODO: Should it be defined as
// py_scopes(this, result)
// instead?
result = this.getCase().getScope()
}
override Scope getScope() { result = this.getCase().getScope() }
/** Gets the case statement containing this pattern */
Case getCase() { result.contains(this) }

View File

@@ -1590,8 +1590,8 @@ import IterableUnpacking
* case ('quit' as c) | ('go', ('up'|'down') as c):
* ...body
* ```
* `command` is the subject of the as-pattern, while the second component of `command` is the subject
* of the first capture pattern. As such, 'subject' refers to the pattern under evaluation.
* `command` is the subject of first the as-pattern, while the second component of `command`
* is the subject of the second as-pattern. As such, 'subject' refers to the pattern under evaluation.
*
* - as pattern: subject flows to alias as well as to the interior pattern
* - or pattern: subject flows to each alternative