Generalise splitting of parenthesized exprs to all statement sequences

This commit is contained in:
Nick Rolfe
2021-03-18 11:21:11 +00:00
parent c8eab42c1d
commit ceda7c8fd2
5 changed files with 8 additions and 8 deletions

View File

@@ -73,8 +73,8 @@ class StmtSequence extends Expr, TStmtSequence {
/** Gets a statement in this sequence. */
final Stmt getAStmt() { result = this.getStmt(_) }
/** Gets the last expression in this sequence, if any. */
final Expr getLastExpr() { result = this.getStmt(this.getNumberOfStatements() - 1) }
/** Gets the last statement in this sequence, if any. */
final Stmt getLastStmt() { result = this.getStmt(this.getNumberOfStatements() - 1) }
/** Gets the number of statements in this sequence. */
final int getNumberOfStatements() { result = count(this.getAStmt()) }