PS: Shorter predicate names for statement blocks.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-08-29 18:42:29 +01:00
parent 7ad60ca59c
commit 2d8a8c00ca
2 changed files with 6 additions and 7 deletions

View File

@@ -9,8 +9,7 @@ class ForEachStmt extends @foreach_statement, LoopStmt {
VarAccess getVariable() { foreach_statement(this, result, _, _, _) } // TODO: Change @ast to @variable_expression in dbscheme
/** ..., if any. */
PipelineBase getCondition() { foreach_statement(this, _, result, _, _) } // TODO: Change @ast to @pipeline_base in dbscheme
PipelineBase getIterableExpr() { foreach_statement(this, _, result, _, _) } // TODO: Change @ast to @pipeline_base in dbscheme
predicate isParallel() { foreach_statement(this, _, _, _, 1) }
}

View File

@@ -3,17 +3,17 @@ import powershell
class StmtBlock extends @statement_block, Ast {
override SourceLocation getLocation() { statement_block_location(this, result) }
int getNumStatements() { statement_block(this, result, _) }
int getNumberOfStmts() { statement_block(this, result, _) }
int getNumTraps() { statement_block(this, _, result) }
Stmt getStatement(int index) { statement_block_statement(this, index, result) }
Stmt getStmt(int index) { statement_block_statement(this, index, result) }
Stmt getAStatement() { result = this.getStatement(_) }
Stmt getAStmt() { result = this.getStmt(_) }
TrapStmt getTrapStatement(int index) { statement_block_trap(this, index, result) }
TrapStmt getTrapStmt(int index) { statement_block_trap(this, index, result) }
TrapStmt getATrapStatement() { result = this.getTrapStatement(_) }
TrapStmt getATrapStmt() { result = this.getTrapStmt(_) }
override string toString() { result = "{...}" }
}