@@ -40,10 +40,12 @@ private module CfgInput implements InputSig<Location> {
4040 predicate successorTypeIsCondition ( SuccessorType t ) { t instanceof Cfg:: BooleanSuccessor }
4141
4242 /** 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+ }
4446
4547 /** 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 ) }
4749}
4850
4951private module CfgSplittingInput implements SplittingInputSig< Location , CfgInput > {
@@ -65,7 +67,7 @@ private module CfgImpl =
6567
6668import CfgImpl
6769
68- class FunctionTree extends StandardTree , Function {
70+ class CfgScopeTree extends StandardTree , Scope :: CfgScope {
6971 override predicate first ( AstNode first ) { first = this }
7072
7173 override predicate last ( AstNode last , Completion c ) {
@@ -319,24 +321,6 @@ module ExprTrees {
319321 override AstNode getChildNode ( int i ) { i = 0 and result = super .getExpr ( ) }
320322 }
321323
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-
340324 class ContinueExprTree extends LeafTree , ContinueExpr {
341325 override predicate last ( AstNode last , Completion c ) { none ( ) }
342326
0 commit comments