@@ -394,6 +394,9 @@ private API::Node getNodeFromPath(string package, string type, AccessPath path,
394
394
// Apply a subpath
395
395
result =
396
396
getNodeFromSubPath ( getNodeFromPath ( package , type , path , n - 1 ) , getSubPathAt ( path , n - 1 ) )
397
+ or
398
+ // Apply a receiver step
399
+ typeStep ( getNodeFromPath ( package , type , path , n ) , result )
397
400
}
398
401
399
402
/**
@@ -419,6 +422,13 @@ private API::Node getNodeFromSubPath(API::Node base, AccessPath subPath, int n)
419
422
n = 0
420
423
)
421
424
or
425
+ exists ( string package , string type , AccessPath basePath |
426
+ typeStepModel ( package , type , basePath , subPath ) and
427
+ base = getNodeFromPath ( package , type , basePath ) and
428
+ result = base and
429
+ n = 0
430
+ )
431
+ or
422
432
result = getSuccessorFromNode ( getNodeFromSubPath ( base , subPath , n - 1 ) , subPath .getToken ( n - 1 ) )
423
433
or
424
434
result =
@@ -451,6 +461,20 @@ API::Node getNodeFromPath(string package, string type, AccessPath path) {
451
461
result = getNodeFromPath ( package , type , path , path .getNumToken ( ) )
452
462
}
453
463
464
+ pragma [ nomagic]
465
+ private predicate typeStepModel ( string package , string type , AccessPath basePath , AccessPath output ) {
466
+ summaryModel ( package , type , basePath , "" , output , "type" )
467
+ }
468
+
469
+ pragma [ nomagic]
470
+ private predicate typeStep ( API:: Node pred , API:: Node succ ) {
471
+ exists ( string package , string type , AccessPath basePath , AccessPath output |
472
+ typeStepModel ( package , type , basePath , output ) and
473
+ pred = getNodeFromPath ( package , type , basePath ) and
474
+ succ = getNodeFromSubPath ( pred , output )
475
+ )
476
+ }
477
+
454
478
/**
455
479
* Gets an invocation identified by the given `(package, type, path)` tuple.
456
480
*
0 commit comments