@@ -76,12 +76,16 @@ abstract class CfgScopeImpl extends AstNode {
76
76
}
77
77
78
78
private class ToplevelScope extends CfgScopeImpl , Toplevel {
79
+ ToplevelScope ( ) { exists ( this .getAStmt ( ) ) }
80
+
79
81
final override predicate entry ( AstNode first ) { first ( this , first ) }
80
82
81
83
final override predicate exit ( AstNode last , Completion c ) { last ( this , last , c ) }
82
84
}
83
85
84
86
private class EndBlockScope extends CfgScopeImpl , EndBlock {
87
+ EndBlockScope ( ) { exists ( this .getAStmt ( ) ) }
88
+
85
89
final override predicate entry ( AstNode first ) {
86
90
first ( this .( Trees:: EndBlockTree ) .getBodyChild ( 0 , _) , first )
87
91
}
@@ -95,6 +99,8 @@ private class EndBlockScope extends CfgScopeImpl, EndBlock {
95
99
}
96
100
97
101
private class BodyStmtCallableScope extends CfgScopeImpl , AstInternal:: TBodyStmt , Callable {
102
+ BodyStmtCallableScope ( ) { exists ( this .getAStmt ( ) ) }
103
+
98
104
final override predicate entry ( AstNode first ) { this .( Trees:: BodyStmtTree ) .firstInner ( first ) }
99
105
100
106
final override predicate exit ( AstNode last , Completion c ) {
@@ -103,6 +109,8 @@ private class BodyStmtCallableScope extends CfgScopeImpl, AstInternal::TBodyStmt
103
109
}
104
110
105
111
private class BraceBlockScope extends CfgScopeImpl , BraceBlock {
112
+ BraceBlockScope ( ) { exists ( this .getAStmt ( ) ) }
113
+
106
114
final override predicate entry ( AstNode first ) {
107
115
first ( this .( Trees:: BraceBlockTree ) .getBodyChild ( 0 , _) , first )
108
116
}
0 commit comments