@@ -47,23 +47,19 @@ module CfgScope {
4747 }
4848
4949 private class BodyStmtCallableScope extends Range_ instanceof AbstractFunctionDecl {
50- Decls:: FuncDeclTree tree ;
51-
52- BodyStmtCallableScope ( ) { tree .getAst ( ) = this }
53-
54- final override predicate entry ( ControlFlowElement first ) { first ( tree , first ) }
55-
56- final override predicate exit ( ControlFlowElement last , Completion c ) { last ( tree , last , c ) }
57- }
58-
59- private class KeyPathScope extends Range_ instanceof KeyPathExpr {
60- AstControlFlowTree tree ;
61-
62- KeyPathScope ( ) { tree .getAst ( ) = this .getParsedRoot ( ) .getFullyConverted ( ) }
63-
64- final override predicate entry ( ControlFlowElement first ) { first ( tree , first ) }
50+ final override predicate entry ( ControlFlowElement first ) {
51+ exists ( Decls:: FuncDeclTree tree |
52+ tree .getAst ( ) = this and
53+ first = tree
54+ )
55+ }
6556
66- final override predicate exit ( ControlFlowElement last , Completion c ) { last ( tree , last , c ) }
57+ final override predicate exit ( ControlFlowElement last , Completion c ) {
58+ exists ( Decls:: FuncDeclTree tree |
59+ tree .getAst ( ) = this and
60+ tree .last ( last , c )
61+ )
62+ }
6763 }
6864}
6965
@@ -1116,20 +1112,6 @@ module Exprs {
11161112 }
11171113 }
11181114
1119- class KeyPathTree extends AstLeafTree {
1120- override KeyPathExpr ast ;
1121- }
1122-
1123- class KeyPathApplicationTree extends AstStandardPostOrderTree {
1124- override KeyPathApplicationExpr ast ;
1125-
1126- final override ControlFlowElement getChildElement ( int i ) {
1127- i = 0 and result .asAstNode ( ) = ast .getBase ( ) .getFullyConverted ( )
1128- or
1129- i = 1 and result .asAstNode ( ) = ast .getKeyPath ( ) .getFullyConverted ( )
1130- }
1131- }
1132-
11331115 private class InOutTree extends AstStandardPostOrderTree {
11341116 override InOutExpr ast ;
11351117
@@ -1666,9 +1648,7 @@ private module Cached {
16661648 result = scopeOfAst ( n .asAstNode ( ) ) or
16671649 result = scopeOfAst ( n .( PropertyGetterElement ) .getRef ( ) ) or
16681650 result = scopeOfAst ( n .( PropertySetterElement ) .getAssignExpr ( ) ) or
1669- result = scopeOfAst ( n .( PropertyObserverElement ) .getAssignExpr ( ) ) or
1670- result = n .( FuncDeclElement ) .getAst ( ) or
1671- result = n .( KeyPathElement ) .getAst ( )
1651+ result = scopeOfAst ( n .( PropertyObserverElement ) .getAssignExpr ( ) )
16721652 }
16731653
16741654 cached
0 commit comments