Parameters and local variables: add isAnonymous predicate

This commit is contained in:
Chris Smowton
2024-03-13 16:52:06 +00:00
parent 7377cbb46e
commit 33b807f3bb
2 changed files with 13 additions and 1 deletions

View File

@@ -117,4 +117,11 @@ class Parameter extends Element, @param, LocalScopeVariable {
}
override string getAPrimaryQlClass() { result = "Parameter" }
override string toString() {
if this.getName() = "" then result = "<anonymous parameter>" else result = super.toString()
}
/** Holds if this is an anonymous parameter, `_` */
predicate isAnonymous() { this.getName() = "" }
}