AST: add SingletonMethod::getObject

This commit is contained in:
Arthur Baars
2021-02-15 13:53:50 +01:00
parent e3f54411d8
commit 5b8c74eb5b
2 changed files with 5 additions and 0 deletions

View File

@@ -46,6 +46,9 @@ class SingletonMethod extends Callable, BodyStatement, @singleton_method {
final override string getAPrimaryQlClass() { result = "SingletonMethod" }
/** Gets the object of this singleton method. */
final Expr getObject() { result = range.getObject() }
/** Gets the name of this method. */
final string getName() { result = range.getName() }
}

View File

@@ -41,6 +41,8 @@ module SingletonMethod {
result = generated.getName().(Generated::Setter).getName().getValue() + "="
}
final Generated::AstNode getObject() { result = generated.getObject() }
final override Generated::AstNode getChild(int i) { result = generated.getChild(i) }
final override string toString() { result = this.getName() }