mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
delete old deprecations
This commit is contained in:
@@ -398,12 +398,6 @@ class ConstantWriteAccess extends ConstantAccess {
|
||||
* constant can be ambiguous from just statically looking at the AST.
|
||||
*/
|
||||
string getAQualifiedName() { result = resolveConstantWrite(this) }
|
||||
|
||||
/**
|
||||
* Gets a qualified name for this constant. Deprecated in favor of
|
||||
* `getAQualifiedName` because this can return more than one value
|
||||
*/
|
||||
deprecated string getQualifiedName() { result = this.getAQualifiedName() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -384,12 +384,6 @@ class CaseExpr extends ControlExpr instanceof CaseExprImpl {
|
||||
*/
|
||||
final AstNode getABranch() { result = this.getBranch(_) }
|
||||
|
||||
/** Gets the `n`th `when` branch of this case expression. */
|
||||
deprecated final WhenClause getWhenBranch(int n) { result = this.getBranch(n) }
|
||||
|
||||
/** Gets a `when` branch of this case expression. */
|
||||
deprecated final WhenClause getAWhenBranch() { result = this.getABranch() }
|
||||
|
||||
/** Gets the `else` branch of this case expression, if any. */
|
||||
final StmtSequence getElseBranch() { result = this.getABranch() }
|
||||
|
||||
@@ -413,11 +407,6 @@ class CaseExpr extends ControlExpr instanceof CaseExprImpl {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `WhenClause` instead.
|
||||
*/
|
||||
deprecated class WhenExpr = WhenClause;
|
||||
|
||||
/**
|
||||
* A `when` branch of a `case` expression.
|
||||
* ```rb
|
||||
|
||||
@@ -22,9 +22,6 @@ class Expr extends Stmt, TExpr {
|
||||
ConstantValue getConstantValue() { result = getConstantValueExpr(this) }
|
||||
}
|
||||
|
||||
/** DEPRECATED: Use `SelfVariableAccess` instead. */
|
||||
deprecated class Self = SelfVariableAccess;
|
||||
|
||||
/**
|
||||
* A sequence of expressions in the right-hand side of an assignment or
|
||||
* a `return`, `break` or `next` statement.
|
||||
|
||||
@@ -68,27 +68,6 @@ class DestructuredParameter extends Parameter, TDestructuredParameter {
|
||||
final override string getAPrimaryQlClass() { result = "DestructuredParameter" }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED
|
||||
*
|
||||
* A parameter defined using a pattern.
|
||||
*
|
||||
* This includes both simple parameters and tuple parameters.
|
||||
*/
|
||||
deprecated class PatternParameter extends Parameter, Pattern, TPatternParameter {
|
||||
override LocalVariable getAVariable() { result = Pattern.super.getAVariable() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED
|
||||
*
|
||||
* A parameter defined using a tuple pattern.
|
||||
*/
|
||||
deprecated class TuplePatternParameter extends PatternParameter, TuplePattern,
|
||||
TDestructuredParameter {
|
||||
final override LocalVariable getAVariable() { result = TuplePattern.super.getAVariable() }
|
||||
}
|
||||
|
||||
/** A named parameter. */
|
||||
class NamedParameter extends Parameter, TNamedParameter {
|
||||
/** Gets the name of this parameter. */
|
||||
|
||||
@@ -5,78 +5,6 @@ private import internal.TreeSitter
|
||||
private import internal.Variable
|
||||
private import internal.Parameter
|
||||
|
||||
/**
|
||||
* DEPRECATED
|
||||
*
|
||||
* A pattern.
|
||||
*/
|
||||
deprecated class Pattern extends AstNode {
|
||||
Pattern() {
|
||||
explicitAssignmentNode(toGenerated(this), _)
|
||||
or
|
||||
implicitAssignmentNode(toGenerated(this))
|
||||
or
|
||||
implicitParameterAssignmentNode(toGenerated(this), _)
|
||||
or
|
||||
this = getSynthChild(any(AssignExpr ae), 0)
|
||||
or
|
||||
this instanceof SimpleParameterImpl
|
||||
}
|
||||
|
||||
/** Gets a variable used in (or introduced by) this pattern. */
|
||||
Variable getAVariable() { none() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED
|
||||
*
|
||||
* A simple variable pattern.
|
||||
*/
|
||||
deprecated class VariablePattern extends Pattern, LhsExpr, TVariableAccess {
|
||||
override Variable getAVariable() { result = this.(VariableAccess).getVariable() }
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED
|
||||
*
|
||||
* A tuple pattern.
|
||||
*
|
||||
* This includes both tuple patterns in parameters and assignments. Example patterns:
|
||||
* ```rb
|
||||
* a, self.b = value
|
||||
* (a, b), c[3] = value
|
||||
* a, b, *rest, c, d = value
|
||||
* ```
|
||||
*/
|
||||
deprecated class TuplePattern extends Pattern, TTuplePattern {
|
||||
private TuplePatternImpl getImpl() { result = toGenerated(this) }
|
||||
|
||||
private Ruby::AstNode getChild(int i) { result = this.getImpl().getChildNode(i) }
|
||||
|
||||
/** Gets the `i`th pattern in this tuple pattern. */
|
||||
final Pattern getElement(int i) {
|
||||
exists(Ruby::AstNode c | c = this.getChild(i) |
|
||||
toGenerated(result) = c.(Ruby::RestAssignment).getChild()
|
||||
or
|
||||
toGenerated(result) = c
|
||||
)
|
||||
}
|
||||
|
||||
/** Gets a sub pattern in this tuple pattern. */
|
||||
final Pattern getAnElement() { result = this.getElement(_) }
|
||||
|
||||
/**
|
||||
* Gets the index of the pattern with the `*` marker on it, if it exists.
|
||||
* In the example below the index is `2`.
|
||||
* ```rb
|
||||
* a, b, *rest, c, d = value
|
||||
* ```
|
||||
*/
|
||||
final int getRestIndex() { result = this.getImpl().getRestIndex() }
|
||||
|
||||
override Variable getAVariable() { result = this.getElement(_).getAVariable() }
|
||||
}
|
||||
|
||||
private class TPatternNode =
|
||||
TArrayPattern or TFindPattern or THashPattern or TAlternativePattern or TAsPattern or
|
||||
TParenthesizedPattern or TExpressionReferencePattern or TVariableReferencePattern;
|
||||
|
||||
@@ -875,15 +875,10 @@ class TParameter =
|
||||
|
||||
class TSimpleParameter = TSimpleParameterReal or TSimpleParameterSynth;
|
||||
|
||||
deprecated class TPatternParameter = TSimpleParameter or TDestructuredParameter;
|
||||
|
||||
class TNamedParameter =
|
||||
TSimpleParameter or TBlockParameter or THashSplatParameter or TKeywordParameter or
|
||||
TOptionalParameter or TSplatParameter;
|
||||
|
||||
deprecated class TTuplePattern =
|
||||
TDestructuredParameter or TDestructuredLeftAssignment or TLeftAssignmentList;
|
||||
|
||||
class TVariableAccess =
|
||||
TLocalVariableAccess or TGlobalVariableAccess or TInstanceVariableAccess or
|
||||
TClassVariableAccess or TSelfVariableAccess;
|
||||
|
||||
@@ -4,25 +4,6 @@ private import codeql.ruby.ast.internal.Parameter
|
||||
private import AST
|
||||
private import TreeSitter
|
||||
|
||||
deprecated class TuplePatternImpl extends Ruby::AstNode {
|
||||
TuplePatternImpl() {
|
||||
this instanceof DestructuredParameterImpl or
|
||||
this instanceof DestructuredLhsExprImpl
|
||||
}
|
||||
|
||||
Ruby::AstNode getChildNode(int i) {
|
||||
result =
|
||||
[
|
||||
this.(DestructuredParameterImpl).getChildNode(i),
|
||||
this.(DestructuredLhsExprImpl).getChildNode(i)
|
||||
]
|
||||
}
|
||||
|
||||
final int getRestIndex() {
|
||||
result = unique(int i | this.getChildNode(i) instanceof Ruby::RestAssignment)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `node` is a case pattern.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user