Skip to content

Commit e683f04

Browse files
committed
PS: Rename getExpr to getBase on ParenExpr.
1 parent 959cbd7 commit e683f04

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

powershell/ql/lib/semmle/code/powershell/ParenExpression.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import powershell
22

33
class ParenExpr extends @paren_expression, Expr {
4-
PipelineBase getExpr() { paren_expression(this, result) }
4+
PipelineBase getBase() { paren_expression(this, result) }
55

66
override SourceLocation getLocation() { paren_expression_location(this, result) }
77

powershell/ql/lib/semmle/code/powershell/controlflow/CfgNodes.qll

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,20 @@ module ExprNodes {
501501

502502
TypeConstraint getType() { result = e.getType() }
503503
}
504+
505+
class ParenExprChildMapping extends ExprChildMapping, ParenExpr {
506+
override predicate relevantChild(Ast n) { n = this.getBase() }
507+
}
508+
509+
class ParenCfgNode extends ExprCfgNode {
510+
override string getAPrimaryQlClass() { result = "ParenExprCfgNode" }
511+
512+
override ParenExprChildMapping e;
513+
514+
override ParenExpr getExpr() { result = e }
515+
516+
final StmtCfgNode getBase() { e.hasCfgChild(e.getBase(), this, result) }
517+
}
504518
}
505519

506520
module StmtNodes {

powershell/ql/lib/semmle/code/powershell/controlflow/internal/ControlFlowGraphImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ module Trees {
601601
}
602602

603603
class ParenExprTree extends StandardPostOrderTree instanceof ParenExpr {
604-
override AstNode getChildNode(int i) { i = 0 and result = super.getExpr() }
604+
override AstNode getChildNode(int i) { i = 0 and result = super.getBase() }
605605
}
606606

607607
class TypeNameExprTree extends LeafTree instanceof TypeNameExpr { }

0 commit comments

Comments
 (0)