Java: Clarify the meaning of getRuleExpression/Statement

This commit is contained in:
Chris Smowton
2022-03-30 17:58:11 +01:00
committed by GitHub
parent fa1bb82701
commit 19cd97e426

View File

@@ -438,11 +438,17 @@ class SwitchCase extends Stmt, @case {
/**
* Gets the expression on the right-hand side of the arrow, if any.
*
* Note this is mutually exclusive with `getRuleStatement`: it gets a value
* when this case is of the form `case e1 -> e2`, where `e2` is not a block.
*/
Expr getRuleExpression() { result.getParent() = this and result.getIndex() = -1 }
/**
* Gets the statement on the right-hand side of the arrow, if any.
*
* Note this is mutually exclusive with `getRuleExpression`: it gets a value
* when this case if of the form `case e1 -> { s1; s2; ... }`.
*/
Stmt getRuleStatement() { result.getParent() = this and result.getIndex() = -1 }
}