From 0c2d864828bbbb978f92701d138e888c26bbde2e Mon Sep 17 00:00:00 2001 From: paulklint Date: Thu, 26 Sep 2024 22:38:45 +0200 Subject: [PATCH] More fixes to getModuleName --- src/org/rascalmpl/library/util/Reflective.rsc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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){