@@ -129,17 +129,16 @@ module MakeAstConsistency<LocationSig Location, AstSig<Location> Ast> {
129129 query = "multipleParents" and
130130 results = strictcount ( AstNode child | multipleParents ( child , _, _) )
131131 or
132- query = "nonAncestorEnclosingCallable" and
133- results = strictcount ( AstNode node | nonAncestorEnclosingCallable ( node , _) )
134- or
135132 query = "childAtMultipleIndices" and
136133 results = strictcount ( AstNode child | childAtMultipleIndices ( _, child , _, _) )
137134 or
138135 query = "siblingsWithIdenticalIndex" and
139- results = strictcount ( AstNode parent , int index | siblingsWithIdenticalIndex ( parent , index , _, _) )
136+ results =
137+ strictcount ( AstNode parent , int index | siblingsWithIdenticalIndex ( parent , index , _, _) )
140138 or
141139 query = "memberChildMissingFromGetChild" and
142- results = strictcount ( AstNode parent , AstNode child | memberChildMissingFromGetChild ( parent , child , _) )
140+ results =
141+ strictcount ( AstNode parent , AstNode child | memberChildMissingFromGetChild ( parent , child , _) )
143142 or
144143 query = "getChildMissingFromMember" and
145144 results = strictcount ( AstNode parent , int index | getChildMissingFromMember ( parent , index , _) )
@@ -152,15 +151,6 @@ module MakeAstConsistency<LocationSig Location, AstSig<Location> Ast> {
152151 parent1 != parent2
153152 }
154153
155- /**
156- * Holds if `node` has an enclosing callable that is not reachable through
157- * parent steps.
158- */
159- query predicate nonAncestorEnclosingCallable ( AstNode node , Callable callable ) {
160- callable = getEnclosingCallable ( node ) and
161- not getParent * ( node ) = callable
162- }
163-
164154 /** Holds if `child` is assigned multiple child indices under `parent`. */
165155 query predicate childAtMultipleIndices ( AstNode parent , AstNode child , int index1 , int index2 ) {
166156 getChild ( parent , index1 ) = child and
@@ -179,6 +169,7 @@ module MakeAstConsistency<LocationSig Location, AstSig<Location> Ast> {
179169
180170 /** Holds if a member child relation is not reflected by `getChild`. */
181171 query predicate memberChildMissingFromGetChild ( AstNode parent , AstNode child , string member ) {
172+ exists ( getEnclosingCallable ( parent ) ) and
182173 astMemberChild ( parent , child , member ) and
183174 not getChild ( parent , _) = child
184175 }
0 commit comments