mirror of
https://github.com/github/codeql.git
synced 2026-04-24 16:25:15 +02:00
Add missing javadoc and getUniquePattern predicate
This commit is contained in:
@@ -551,8 +551,16 @@ class PatternCase extends SwitchCase {
|
||||
*/
|
||||
PatternExpr getPatternAtIndex(int n) { result.isNthChildOf(this, n) }
|
||||
|
||||
/**
|
||||
* Gets any of this case's patterns.
|
||||
*/
|
||||
PatternExpr getAPattern() { result = this.getPatternAtIndex(_) }
|
||||
|
||||
/**
|
||||
* Gets this case's sole pattern, if there is exactly one.
|
||||
*/
|
||||
PatternExpr getUniquePattern() { result = unique(PatternExpr pe | pe = this.getPatternAtIndex(_)) }
|
||||
|
||||
/** Gets the guard applicable to this pattern case, if any. */
|
||||
Expr getGuard() { result.isNthChildOf(this, -3) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user