mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Add basic support for case guards
This commit is contained in:
@@ -523,6 +523,9 @@ class PatternCase extends SwitchCase {
|
||||
/** Gets the variable declared by this pattern case. */
|
||||
LocalVariableDeclExpr getDecl() { result.isNthChildOf(this, 0) }
|
||||
|
||||
/** Gets the guard applicable to this pattern case, if any. */
|
||||
Expr getGuard() { result.isNthChildOf(this, -3) }
|
||||
|
||||
override string pp() { result = "case T t ..." }
|
||||
|
||||
override string toString() { result = "case T t ..." }
|
||||
|
||||
Reference in New Issue
Block a user