Address review feedback

This commit is contained in:
Nick Rolfe
2020-12-18 10:08:45 +00:00
parent a87fe410af
commit 4718de08b2
8 changed files with 32 additions and 72 deletions

View File

@@ -22,7 +22,8 @@ class Literal extends Expr {
override string toString() { result = this.getValueText() }
string getValueText() { result = range.getValueText() }
/** Gets the source text for this literal. */
final string getValueText() { result = range.getValueText() }
}
/**

View File

@@ -10,10 +10,10 @@ class Operation extends Expr {
override Operation::Range range;
/** Gets the operator of this operation. */
string getOperator() { result = range.getOperator() }
final string getOperator() { result = range.getOperator() }
/** Gets an operand of this operation. */
Expr getAnOperand() { result = range.getAnOperand() }
final Expr getAnOperand() { result = range.getAnOperand() }
}
/** A unary operation. */
@@ -21,7 +21,7 @@ class UnaryOperation extends Operation, @unary {
override UnaryOperation::Range range;
/** Gets the operand of this unary operation. */
Expr getOperand() { result = range.getOperand() }
final Expr getOperand() { result = range.getOperand() }
override string toString() { result = this.getOperator() + " ..." }
}
@@ -109,10 +109,10 @@ class BinaryOperation extends Operation, @binary {
override string toString() { result = "... " + this.getOperator() + " ..." }
/** Gets the left operand of this binary operation. */
Expr getLeftOperand() { result = range.getLeftOperand() }
final Expr getLeftOperand() { result = range.getLeftOperand() }
/** Gets the right operand of this binary operation. */
Expr getRightOperand() { result = range.getRightOperand() }
final Expr getRightOperand() { result = range.getRightOperand() }
}
/**
@@ -351,9 +351,9 @@ class CaseEqExpr extends EqualityOperation, @binary_equalequalequal {
class RelationalOperation extends ComparisonOperation {
override RelationalOperation::Range range;
Expr getGreaterOperand() { result = range.getGreaterOperand() }
final Expr getGreaterOperand() { result = range.getGreaterOperand() }
Expr getLesserOperand() { result = range.getLesserOperand() }
final Expr getLesserOperand() { result = range.getLesserOperand() }
}
/**
@@ -451,10 +451,10 @@ class Assignment extends Operation {
override string toString() { result = "... " + this.getOperator() + " ..." }
/** Gets the left hand side of this assignment. */
Expr getLhs() { result = range.getLhs() }
final Expr getLhs() { result = range.getLhs() }
/** Gets the right hand side of this assignment. */
Expr getRhs() { result = range.getRhs() }
final Expr getRhs() { result = range.getRhs() }
}
/**

View File

@@ -76,7 +76,7 @@ class LocalVariableAccess extends VariableAccess {
final override LocalVariableAccess::Range range;
/** Gets the variable this identifier refers to. */
override LocalVariable getVariable() { result = range.getVariable() }
final override LocalVariable getVariable() { result = range.getVariable() }
final override string getAPrimaryQlClass() { result = "LocalVariableAccess" }
}

View File

@@ -213,9 +213,7 @@ module NoRegexMatchExpr {
}
module Assignment {
class DbUnion = @operator_assignment or @assignment;
abstract class Range extends Operation::Range, DbUnion {
abstract class Range extends Operation::Range {
abstract Expr getLhs();
abstract Expr getRhs();