PS: Rename getExpr to getBase on ParenExpr.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-10-15 13:37:03 +01:00
parent 959cbd7467
commit e683f04e7b
3 changed files with 16 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
import powershell
class ParenExpr extends @paren_expression, Expr {
PipelineBase getExpr() { paren_expression(this, result) }
PipelineBase getBase() { paren_expression(this, result) }
override SourceLocation getLocation() { paren_expression_location(this, result) }

View File

@@ -501,6 +501,20 @@ module ExprNodes {
TypeConstraint getType() { result = e.getType() }
}
class ParenExprChildMapping extends ExprChildMapping, ParenExpr {
override predicate relevantChild(Ast n) { n = this.getBase() }
}
class ParenCfgNode extends ExprCfgNode {
override string getAPrimaryQlClass() { result = "ParenExprCfgNode" }
override ParenExprChildMapping e;
override ParenExpr getExpr() { result = e }
final StmtCfgNode getBase() { e.hasCfgChild(e.getBase(), this, result) }
}
}
module StmtNodes {

View File

@@ -601,7 +601,7 @@ module Trees {
}
class ParenExprTree extends StandardPostOrderTree instanceof ParenExpr {
override AstNode getChildNode(int i) { i = 0 and result = super.getExpr() }
override AstNode getChildNode(int i) { i = 0 and result = super.getBase() }
}
class TypeNameExprTree extends LeafTree instanceof TypeNameExpr { }