diff --git a/src/org/rascalmpl/library/util/Reflective.rsc b/src/org/rascalmpl/library/util/Reflective.rsc index 14e1e76d7b0..8ae7a24ee12 100644 --- a/src/org/rascalmpl/library/util/Reflective.rsc +++ b/src/org/rascalmpl/library/util/Reflective.rsc @@ -213,10 +213,13 @@ str getModuleName(loc moduleLoc, PathConfig pcfg){ while(candidate[0] == "/"){ candidate = candidate[1..]; } - if(candidate[0] == "$"){ - candidate = candidate[1..]; - } + candidateAsList = split("/", candidate); + lastName = candidateAsList[-1]; + if(lastName[0] == "$"){ + candidateAsList = [*candidateAsList[..-1],lastName[1..]]; + } + //println("cand: , modpath: "); n = commonPrefix(reverse(candidateAsList), modulePathReversed); if(n > longestSuffix){