Skip to content

Commit

Permalink
More fixes to getModuleName
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKlint committed Sep 26, 2024
1 parent 5e213b6 commit 0c2d864
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/org/rascalmpl/library/util/Reflective.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -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: <candidateAsList>, modpath: <modulePathAsList>");
n = commonPrefix(reverse(candidateAsList), modulePathReversed);

if(n > longestSuffix){
Expand Down

0 comments on commit 0c2d864

Please sign in to comment.