@@ -59,6 +59,10 @@ module CfgImpl = Make<Location, CfgInput>;
59
59
60
60
import CfgImpl
61
61
62
+ class AwaitExprTree extends StandardPostOrderTree instanceof AwaitExpr {
63
+ override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
64
+ }
65
+
62
66
class BinaryOpExprTree extends StandardPostOrderTree instanceof BinaryOpExpr {
63
67
BinaryOpExprTree ( ) { super .getOp ( ) != "&&" and super .getOp ( ) != "||" }
64
68
@@ -129,7 +133,8 @@ class LogicalAndBinaryOpExprTree extends PreOrderTree instanceof BinaryOpExpr {
129
133
}
130
134
}
131
135
132
- class BlockExprTree extends StandardPostOrderTree instanceof BlockExpr {
136
+ // NOTE: This covers both normal blocks, async blocks, and unsafe blocks
137
+ class BaseBlockExprTree extends StandardPostOrderTree instanceof BlockExprBase {
133
138
override ControlFlowTree getChildNode ( int i ) {
134
139
result = super .getStatement ( i )
135
140
or
@@ -154,11 +159,16 @@ class BreakExprTree extends PostOrderTree instanceof BreakExpr {
154
159
}
155
160
156
161
class CallExprTree extends StandardPostOrderTree instanceof CallExpr {
157
- override ControlFlowTree getChildNode ( int i ) { result = super .getArg ( i ) }
162
+ override ControlFlowTree getChildNode ( int i ) {
163
+ result = super .getCallee ( ) and
164
+ result = super .getArg ( i + 1 )
165
+ }
158
166
}
159
167
160
168
class ClosureExprTree extends LeafTree instanceof ClosureExpr { }
161
169
170
+ class ConstExprTree extends LeafTree instanceof ConstExpr { }
171
+
162
172
class ContinueExprTree extends LeafTree instanceof ContinueExpr { }
163
173
164
174
class ExprStmtTree extends StandardPostOrderTree instanceof ExprStmt {
@@ -239,6 +249,10 @@ class LoopExprTree extends PostOrderTree instanceof LoopExpr {
239
249
240
250
class PathExprTree extends LeafTree instanceof PathExpr { }
241
251
252
+ class RecordLitExprTree extends StandardPostOrderTree instanceof RecordLitExpr {
253
+ override ControlFlowTree getChildNode ( int i ) { result = super .getField ( i ) .getExpr ( ) }
254
+ }
255
+
242
256
class ReturnExprTree extends PostOrderTree instanceof ReturnExpr {
243
257
override predicate propagatesAbnormal ( AstNode child ) { child = super .getExpr ( ) }
244
258
@@ -253,5 +267,15 @@ class ReturnExprTree extends PostOrderTree instanceof ReturnExpr {
253
267
}
254
268
}
255
269
270
+ class TupleExprTree extends StandardPostOrderTree instanceof TupleExpr {
271
+ override ControlFlowTree getChildNode ( int i ) { result = super .getExpr ( i ) }
272
+ }
273
+
274
+ class UnderscoreExprTree extends LeafTree instanceof UnderscoreExpr { }
275
+
276
+ class UnaryOpExprTree extends StandardPostOrderTree instanceof UnaryOpExpr {
277
+ override ControlFlowTree getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
278
+ }
279
+
256
280
// A leaf tree for unimplemented nodes in the AST.
257
281
class UnimplementedTree extends LeafTree instanceof Unimplemented { }
0 commit comments