@@ -198,14 +198,18 @@ private module Impl {
198198 }
199199
200200 private Element getImmediateChildOfDecl ( Decl e , int index , string partialPredicateCall ) {
201- exists ( int b , int bAstNode , int n |
201+ exists ( int b , int bAstNode , int n , int nMember |
202202 b = 0 and
203203 bAstNode = b + 1 + max ( int i | i = - 1 or exists ( getImmediateChildOfAstNode ( e , i , _) ) | i ) and
204204 n = bAstNode and
205+ nMember = n + 1 + max ( int i | i = - 1 or exists ( e .getImmediateMember ( i ) ) | i ) and
205206 (
206207 none ( )
207208 or
208209 result = getImmediateChildOfAstNode ( e , index - b , partialPredicateCall )
210+ or
211+ result = e .getImmediateMember ( index - n ) and
212+ partialPredicateCall = "Member(" + ( index - n ) .toString ( ) + ")"
209213 )
210214 )
211215 }
@@ -230,25 +234,6 @@ private module Impl {
230234 )
231235 }
232236
233- private Element getImmediateChildOfIterableDeclContext (
234- IterableDeclContext e , int index , string partialPredicateCall
235- ) {
236- exists ( int b , int bElement , int n , int nMember |
237- b = 0 and
238- bElement = b + 1 + max ( int i | i = - 1 or exists ( getImmediateChildOfElement ( e , i , _) ) | i ) and
239- n = bElement and
240- nMember = n + 1 + max ( int i | i = - 1 or exists ( e .getImmediateMember ( i ) ) | i ) and
241- (
242- none ( )
243- or
244- result = getImmediateChildOfElement ( e , index - b , partialPredicateCall )
245- or
246- result = e .getImmediateMember ( index - n ) and
247- partialPredicateCall = "Member(" + ( index - n ) .toString ( ) + ")"
248- )
249- )
250- }
251-
252237 private Element getImmediateChildOfEnumCaseDecl (
253238 EnumCaseDecl e , int index , string partialPredicateCall
254239 ) {
@@ -267,26 +252,19 @@ private module Impl {
267252 private Element getImmediateChildOfExtensionDecl (
268253 ExtensionDecl e , int index , string partialPredicateCall
269254 ) {
270- exists ( int b , int bGenericContext , int bIterableDeclContext , int bDecl , int n |
255+ exists ( int b , int bGenericContext , int bDecl , int n |
271256 b = 0 and
272257 bGenericContext =
273258 b + 1 + max ( int i | i = - 1 or exists ( getImmediateChildOfGenericContext ( e , i , _) ) | i ) and
274- bIterableDeclContext =
275- bGenericContext + 1 +
276- max ( int i | i = - 1 or exists ( getImmediateChildOfIterableDeclContext ( e , i , _) ) | i ) and
277259 bDecl =
278- bIterableDeclContext + 1 +
279- max ( int i | i = - 1 or exists ( getImmediateChildOfDecl ( e , i , _) ) | i ) and
260+ bGenericContext + 1 + max ( int i | i = - 1 or exists ( getImmediateChildOfDecl ( e , i , _) ) | i ) and
280261 n = bDecl and
281262 (
282263 none ( )
283264 or
284265 result = getImmediateChildOfGenericContext ( e , index - b , partialPredicateCall )
285266 or
286- result =
287- getImmediateChildOfIterableDeclContext ( e , index - bGenericContext , partialPredicateCall )
288- or
289- result = getImmediateChildOfDecl ( e , index - bIterableDeclContext , partialPredicateCall )
267+ result = getImmediateChildOfDecl ( e , index - bGenericContext , partialPredicateCall )
290268 )
291269 )
292270 }
@@ -799,21 +777,15 @@ private module Impl {
799777 private Element getImmediateChildOfNominalTypeDecl (
800778 NominalTypeDecl e , int index , string partialPredicateCall
801779 ) {
802- exists ( int b , int bGenericTypeDecl , int bIterableDeclContext , int n |
780+ exists ( int b , int bGenericTypeDecl , int n |
803781 b = 0 and
804782 bGenericTypeDecl =
805783 b + 1 + max ( int i | i = - 1 or exists ( getImmediateChildOfGenericTypeDecl ( e , i , _) ) | i ) and
806- bIterableDeclContext =
807- bGenericTypeDecl + 1 +
808- max ( int i | i = - 1 or exists ( getImmediateChildOfIterableDeclContext ( e , i , _) ) | i ) and
809- n = bIterableDeclContext and
784+ n = bGenericTypeDecl and
810785 (
811786 none ( )
812787 or
813788 result = getImmediateChildOfGenericTypeDecl ( e , index - b , partialPredicateCall )
814- or
815- result =
816- getImmediateChildOfIterableDeclContext ( e , index - bGenericTypeDecl , partialPredicateCall )
817789 )
818790 )
819791 }
0 commit comments