Skip to content

Commit

Permalink
Now also consider libs directories for getModuleName & getModuleLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKlint committed Sep 18, 2024
1 parent 5bba6e4 commit 6143036
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/org/rascalmpl/library/util/Reflective.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ loc getSearchPathLoc(str filePath, PathConfig pcfg){
@synopsis{Get the location of a named module, search for `src` in srcs and `tpl` in libs}
loc getModuleLocation(str qualifiedModuleName, PathConfig pcfg){
fileName = makeFileName(qualifiedModuleName, extension="rsc");
for(loc dir <- pcfg.srcs){
for(loc dir <- pcfg.srcs + pcfg.libs){
fileLoc = dir + fileName;
if(exists(fileLoc)){
return fileLoc;
Expand Down Expand Up @@ -174,7 +174,7 @@ str getModuleName(loc moduleLoc, PathConfig pcfg){
modulePathAsList = split("/", modulePathNoExt);
modulePathAsListReversed = reverse(modulePathAsList);

for(loc dir <- pcfg.srcs){
for(loc dir <- pcfg.srcs + pcfg.libs){
if(moduleLoc.authority == dir.authority && startsWith(modulePath, dir.path)) {
moduleName = replaceFirst(modulePath, dir.path, "");
<moduleName, ext> = splitFileExtension(moduleName);
Expand Down

0 comments on commit 6143036

Please sign in to comment.