mirror of
https://github.com/github/codeql.git
synced 2026-02-20 08:53:49 +01:00
Revert "Rename Method -> MethodDeclaration"
This reverts commit d361ef37af.
This commit is contained in:
@@ -123,7 +123,7 @@ private class Ensure extends StmtSequence, TEnsure {
|
||||
class BodyStmt extends StmtSequence, TBodyStmt {
|
||||
// Not defined by dispatch, as it should not be exposed
|
||||
private Generated::AstNode getChild(int i) {
|
||||
result = any(Generated::Method g | this = TMethodDeclaration(g)).getChild(i)
|
||||
result = any(Generated::Method g | this = TMethod(g)).getChild(i)
|
||||
or
|
||||
result = any(Generated::SingletonMethod g | this = TSingletonMethod(g)).getChild(i)
|
||||
or
|
||||
|
||||
@@ -32,12 +32,12 @@ class MethodBase extends Callable, BodyStmt, Scope, TMethodBase {
|
||||
}
|
||||
|
||||
/** A normal method. */
|
||||
class MethodDeclaration extends MethodBase, TMethodDeclaration {
|
||||
class Method extends MethodBase, TMethod {
|
||||
private Generated::Method g;
|
||||
|
||||
MethodDeclaration() { this = TMethodDeclaration(g) }
|
||||
Method() { this = TMethod(g) }
|
||||
|
||||
final override string getAPrimaryQlClass() { result = "MethodDeclaration" }
|
||||
final override string getAPrimaryQlClass() { result = "Method" }
|
||||
|
||||
final override string getName() {
|
||||
result = g.getName().(Generated::Token).getValue() or
|
||||
|
||||
@@ -138,7 +138,7 @@ private module Cached {
|
||||
g instanceof @binary_and or g instanceof @binary_ampersandampersand
|
||||
} or
|
||||
TLogicalOrExpr(Generated::Binary g) { g instanceof @binary_or or g instanceof @binary_pipepipe } or
|
||||
TMethodDeclaration(Generated::Method g) or
|
||||
TMethod(Generated::Method g) or
|
||||
TModuleDeclaration(Generated::Module g) or
|
||||
TModuloExpr(Generated::Binary g) { g instanceof @binary_percent } or
|
||||
TMulExpr(Generated::Binary g) { g instanceof @binary_star } or
|
||||
@@ -301,7 +301,7 @@ private module Cached {
|
||||
n = TLocalVariableAccess(result, _) or
|
||||
n = TLogicalAndExpr(result) or
|
||||
n = TLogicalOrExpr(result) or
|
||||
n = TMethodDeclaration(result) or
|
||||
n = TMethod(result) or
|
||||
n = TModuleDeclaration(result) or
|
||||
n = TModuloExpr(result) or
|
||||
n = TMulExpr(result) or
|
||||
@@ -402,8 +402,7 @@ class TStmtSequence =
|
||||
TBeginBlock or TEndBlock or TThen or TElse or TDo or TEnsure or TStringInterpolationComponent or
|
||||
TBlock or TBodyStmt or TParenthesizedExpr;
|
||||
|
||||
class TBodyStmt =
|
||||
TBeginExpr or TModuleBase or TMethodDeclaration or TLambda or TDoBlock or TSingletonMethod;
|
||||
class TBodyStmt = TBeginExpr or TModuleBase or TMethod or TLambda or TDoBlock or TSingletonMethod;
|
||||
|
||||
class TLiteral =
|
||||
TNumericLiteral or TNilLiteral or TBooleanLiteral or TStringlikeLiteral or TCharacterLiteral or
|
||||
@@ -429,7 +428,7 @@ class TArrayLiteral = TRegularArrayLiteral or TStringArrayLiteral or TSymbolArra
|
||||
|
||||
class TCallable = TMethodBase or TLambda or TBlock;
|
||||
|
||||
class TMethodBase = TMethodDeclaration or TSingletonMethod;
|
||||
class TMethodBase = TMethod or TSingletonMethod;
|
||||
|
||||
class TBlock = TDoBlock or TBraceBlock;
|
||||
|
||||
|
||||
@@ -301,11 +301,11 @@ private Module getAncestors(Module m) {
|
||||
result = getAncestors(m.getAPrependedModule())
|
||||
}
|
||||
|
||||
MethodDeclaration getMethod(TModule owner, string name) {
|
||||
Method getMethod(TModule owner, string name) {
|
||||
exists(ModuleBase m | m.getModule() = owner and result = m.getMethod(name))
|
||||
}
|
||||
|
||||
private MethodDeclaration lookupMethod0(Module m, string name) {
|
||||
private Method lookupMethod0(Module m, string name) {
|
||||
result = lookupMethod0(m.getAPrependedModule(), name)
|
||||
or
|
||||
not exists(getMethod(getAncestors(m.getAPrependedModule()), name)) and
|
||||
@@ -316,7 +316,7 @@ private MethodDeclaration lookupMethod0(Module m, string name) {
|
||||
)
|
||||
}
|
||||
|
||||
MethodDeclaration lookupMethod(Module m, string name) {
|
||||
Method lookupMethod(Module m, string name) {
|
||||
result = lookupMethod0(m, name)
|
||||
or
|
||||
not exists(lookupMethod0(m, name)) and
|
||||
|
||||
Reference in New Issue
Block a user