AST: change return type of Assignment LHS to Pattern

This commit is contained in:
Arthur Baars
2021-02-18 21:07:18 +01:00
parent 190978cc56
commit 8913810bf0
2 changed files with 5 additions and 3 deletions

View File

@@ -445,7 +445,7 @@ class Assignment extends Operation {
override Assignment::Range range;
/** Gets the left hand side of this assignment. */
final Expr getLeftOperand() { result = range.getLeftOperand() }
Pattern getLeftOperand() { result = range.getLeftOperand() }
/** Gets the right hand side of this assignment. */
final Expr getRightOperand() { result = range.getRightOperand() }
@@ -554,6 +554,8 @@ class AssignExponentExpr extends AssignArithmeticOperation, @operator_assignment
*/
class AssignLogicalOperation extends AssignOperation {
override AssignLogicalOperation::Range range;
final override LhsExpr getLeftOperand() { result = super.getLeftOperand() }
}
/**

View File

@@ -245,7 +245,7 @@ module NoRegexMatchExpr {
module Assignment {
abstract class Range extends Operation::Range {
abstract Expr getLeftOperand();
abstract Pattern getLeftOperand();
abstract Expr getRightOperand();
@@ -269,7 +269,7 @@ module AssignExpr {
class Range extends Assignment::Range, @assignment {
final override Generated::Assignment generated;
final override Expr getLeftOperand() { result = generated.getLeft() }
final override Pattern getLeftOperand() { result = generated.getLeft() }
final override Expr getRightOperand() { result = generated.getRight() }