mirror of
https://github.com/github/codeql.git
synced 2026-02-07 18:51:06 +01:00
add super nodes
This commit is contained in:
committed by
GitHub
parent
5dcc161f2d
commit
2d86b13d44
@@ -1523,6 +1523,13 @@ class ThisAccess extends Identifier {
|
||||
override string getAPrimaryQlClass() { result = "ThisAccess" }
|
||||
}
|
||||
|
||||
/** A use of `super`. */
|
||||
class Super extends TSuper, Expr {
|
||||
Super() { this = TSuper(_) }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "SuperAccess" }
|
||||
}
|
||||
|
||||
/** An access to `result`. */
|
||||
class ResultAccess extends Identifier {
|
||||
ResultAccess() { any(Generated::Result r).getParent() = id }
|
||||
|
||||
@@ -24,6 +24,7 @@ newtype TAstNode =
|
||||
TExprAggregate(Generated::Aggregate agg) {
|
||||
agg.getChild(_) instanceof Generated::ExprAggregateBody
|
||||
} or
|
||||
TSuper(Generated::SuperRef sup) or
|
||||
TIdentifier(Generated::Variable var) or
|
||||
TAsExpr(Generated::AsExpr asExpr) { asExpr.getChild(1) instanceof Generated::VarName } or
|
||||
TPredicateCall(Generated::CallOrUnqualAggExpr call) or
|
||||
@@ -63,7 +64,7 @@ class TBinOpExpr = TAddSubExpr or TMulDivModExpr;
|
||||
|
||||
class TExpr =
|
||||
TBinOpExpr or TLiteral or TAggregate or TExprAggregate or TIdentifier or TInlineCast or TCall or
|
||||
TUnaryExpr or TExprAnnotation or TDontCare or TRange or TSet or TAsExpr;
|
||||
TUnaryExpr or TExprAnnotation or TDontCare or TRange or TSet or TAsExpr or TSuper;
|
||||
|
||||
class TCall = TPredicateCall or TMemberCall or TNoneCall or TAnyCall;
|
||||
|
||||
@@ -154,6 +155,8 @@ Generated::AstNode toGenerated(AST::AstNode n) {
|
||||
n = TNoneCall(result)
|
||||
or
|
||||
n = TAnyCall(result)
|
||||
or
|
||||
n = TSuper(result)
|
||||
}
|
||||
|
||||
class TPredicate = TCharPred or TClasslessPredicate or TClassPredicate;
|
||||
|
||||
Reference in New Issue
Block a user