@@ -40,10 +40,12 @@ private module CfgInput implements InputSig<Location> {
40
40
predicate successorTypeIsCondition ( SuccessorType t ) { t instanceof Cfg:: BooleanSuccessor }
41
41
42
42
/** Holds if `first` is first executed when entering `scope`. */
43
- predicate scopeFirst ( CfgScope scope , AstNode first ) { scope .scopeFirst ( first ) }
43
+ predicate scopeFirst ( CfgScope scope , AstNode first ) {
44
+ first ( scope .( CfgScopeTree ) .getFirstChildNode ( ) , first )
45
+ }
44
46
45
47
/** Holds if `scope` is exited when `last` finishes with completion `c`. */
46
- predicate scopeLast ( CfgScope scope , AstNode last , Completion c ) { scope .scopeLast ( last , c ) }
48
+ predicate scopeLast ( CfgScope scope , AstNode last , Completion c ) { last ( scope .getBody ( ) , last , c ) }
47
49
}
48
50
49
51
private module CfgSplittingInput implements SplittingInputSig< Location , CfgInput > {
@@ -65,7 +67,7 @@ private module CfgImpl =
65
67
66
68
import CfgImpl
67
69
68
- class FunctionTree extends StandardTree , Function {
70
+ class CfgScopeTree extends StandardTree , Scope :: CfgScope {
69
71
override predicate first ( AstNode first ) { first = this }
70
72
71
73
override predicate last ( AstNode last , Completion c ) {
@@ -319,24 +321,6 @@ module ExprTrees {
319
321
override AstNode getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
320
322
}
321
323
322
- class ClosureExprTree extends StandardTree , ClosureExpr {
323
- override predicate first ( AstNode first ) { first = this }
324
-
325
- override predicate last ( AstNode last , Completion c ) {
326
- last = this and
327
- completionIsValidFor ( c , this )
328
- }
329
-
330
- override predicate propagatesAbnormal ( AstNode child ) { none ( ) }
331
-
332
- override AstNode getChildNode ( int i ) {
333
- result = this .getParamList ( ) .getParam ( i )
334
- or
335
- i = this .getParamList ( ) .getNumberOfParams ( ) and
336
- result = this .getBody ( )
337
- }
338
- }
339
-
340
324
class ContinueExprTree extends LeafTree , ContinueExpr {
341
325
override predicate last ( AstNode last , Completion c ) { none ( ) }
342
326
0 commit comments