Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKlint committed Sep 18, 2024
1 parent b2ba5af commit 9c86bd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ public PathConfig getTypePalProjectPathConfig() {
bin = git + "generated-sources/target/classes",
generatedSources = git + "generated-sources/target/generated-sources/src/main/java/",
generatedTestSources = git + "generated-sources/target/generated-sources/src/main/java/",
resources = git + "generated-sources/target/generated-resources/src/main/java/", //|project://rascal-core/target/generated-test-resources|,
libs = [ |lib://rascal/| ]
resources = git + "generated-sources/target/generated-resources/src/main/java/",
libs = [ |jar+file:///Users/paulklint/.m2/repository/org/rascalmpl/rascal/0.40.8-SNAPSHOT/rascal-0.40.8-SNAPSHOT.jar!/| ]
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,44 +440,6 @@ void rascalPostSolver(map[str,Tree] namedTrees, Solver s){

bool isLogicalLoc(loc l)
= startsWith(l.scheme, "rascal+");

// TODO: temporary, fix should be in util::Reflective
str getModuleName(loc moduleLoc, PathConfig pcfg, set[str] extensions = {"tc", "tpl"}){
modulePath = moduleLoc.path;

if(!endsWith(modulePath, "rsc")){
throw "Not a Rascal source file: <moduleLoc>";
}

for(loc dir <- pcfg.srcs + pcfg.libs){
if(startsWith(modulePath, dir.path) && moduleLoc.scheme == dir.scheme && moduleLoc.authority == dir.authority){
moduleName = replaceFirst(modulePath, dir.path, "");
moduleName = replaceLast(moduleName, ".rsc", "");
if(moduleName[0] == "/"){
moduleName = moduleName[1..];
}
moduleName = replaceAll(moduleName, "/", "::");
return moduleName;
}
}

for(loc dir <- pcfg.libs){
if(startsWith(modulePath, dir.path) && moduleLoc.scheme == dir.scheme && moduleLoc.authority == dir.authority){
moduleName = replaceFirst(modulePath, dir.path, "");
<moduleName, ext> = splitFileExtension(moduleName);
if(ext in extensions){
if(moduleName[0] == "/"){
moduleName = moduleName[1..];
}
moduleName = replaceAll(moduleName, "/", "::");
return moduleName;
}
}
}


throw "No module name found for <moduleLoc>;\nsrcs=<pcfg.srcs>;\nlibs=<pcfg.libs>";
}

loc rascalCreateLogicalLoc(Define def, str modelName, PathConfig pcfg){
if(def.idRole in keepInTModelRoles){
Expand Down

0 comments on commit 9c86bd7

Please sign in to comment.