diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/check/Checker.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/check/Checker.rsc index ba5da4b1..b1e28aba 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/Checker.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/Checker.rsc @@ -130,8 +130,8 @@ ModuleStatus rascalTModelForLocs( for (mloc <- mlocs) { m = getModuleName(mloc, pcfg); - if(isModuleLocationInLibs(mloc, pcfg)){ - ms.status[m] ? {} += rsc_not_found(); + if(isModuleLocationInLibs(m, mloc, pcfg)){ + ms.status[m] ? {} += {rsc_not_found()}; } topModuleNames += {m}; ms.moduleLocs[m] = mloc; @@ -186,6 +186,9 @@ ModuleStatus rascalTModelForLocs( while(mi < nmodules) { component = module2component[ordered[mi]]; + if(component == {"IO"}){ + println("IO"); + } jobStep(jobName, intercalate(" + ", [*component]), work=size(component)); recheck = !all(m <- component, ms.status[m]?, (tpl_uptodate() in ms.status[m] || checked() in ms.status[m])); @@ -382,7 +385,7 @@ tuple[TModel, ModuleStatus] rascalTModelComponent(set[str] moduleNames, ModuleSt ms.status[nm] = {}; ms.messages[nm] = []; mloc = getModuleLocation(nm, pcfg); - if(mloc.extension != "rsc" || isModuleLocationInLibs(mloc, pcfg)){ + if(mloc.extension != "rsc" || isModuleLocationInLibs(nm, mloc, pcfg)){ continue; } = getModuleParseTree(nm, ms); diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc index 9e0d37cc..2a60e38b 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc @@ -73,8 +73,11 @@ data ModuleStatus = ModuleStatus newModuleStatus(RascalCompilerConfig ccfg) = moduleStatus({}, {}, (), [], (), [], (), (), (), (), ccfg.typepalPathConfig, ccfg); -bool isModuleLocationInLibs(loc l, PathConfig pcfg) - = !isEmpty(pcfg.libs) && any(lib <- pcfg.libs, l.scheme == lib.scheme && l.path == lib.path); +bool isModuleLocationInLibs(str mname, loc l, PathConfig pcfg){ + res = l.extension == "tpl" || !isEmpty(pcfg.libs) && any(lib <- pcfg.libs, l.scheme == lib.scheme && l.path == lib.path); + //println("isModuleLocationInLibs: , ==\> "); + return res; +} bool traceTPL = false; bool traceParseTreeCache = false; @@ -148,7 +151,7 @@ tuple[bool, Module, ModuleStatus] getModuleParseTree(str qualifiedModuleName, Mo try { mloc = getModuleLocation(qualifiedModuleName, pcfg); // Make sure we found a real source module (as opposed to a tpl module in a library - if(mloc.extension != "rsc" || isModuleLocationInLibs(mloc, pcfg)) { + if(isModuleLocationInLibs(qualifiedModuleName, mloc, pcfg)) { ms.status[qualifiedModuleName] += {rsc_not_found()}; throw "No src or library module"; } @@ -286,8 +289,12 @@ tuple[bool, TModel, ModuleStatus] getTModelForModule(str qualifiedModuleName, Mo try { tpl = readBinaryValueFile(#TModel, tplLoc); if(tpl.rascalTplVersion? && isValidRascalTplVersion(tpl.rascalTplVersion)){ + tpl.convertedToPhysical = false; // temporary tpl = convertTModel2PhysicalLocs(tpl); - + mloc = getModuleLocation(qualifiedModuleName, pcfg); + if(isModuleLocationInLibs(qualifiedModuleName, mloc, pcfg)){ + ms.status[qualifiedModuleName] ? {} += rsc_not_found(); + } ms.tmodels[qualifiedModuleName] = tpl; ms.status[qualifiedModuleName] ? {} += {tpl_uptodate(), tpl_saved()}; if(qualifiedModuleName notin hardwired){ diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc index 2abfeda4..231340ab 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc @@ -132,7 +132,7 @@ ModuleStatus getImportAndExtendGraph(str qualifiedModuleName, ModuleStatus ms){ if(!allImportsAndExtendsValid){ // Check that the source code of qualifiedModuleName is available try { mloc = getModuleLocation(qualifiedModuleName, pcfg); - if(mloc.extension != "rsc" || isModuleLocationInLibs(mloc, pcfg)) throw "No src or library module 1"; //There is only a tpl file available + if(mloc.extension != "rsc" || isModuleLocationInLibs(qualifiedModuleName, mloc, pcfg)) throw "No src or library module 1"; //There is only a tpl file available } catch value _:{ = isCompatibleBinaryLibrary(tm, domain(localImportsAndExtends), ms); if(!compatible){ @@ -259,7 +259,7 @@ tuple[ModuleStatus, rel[str, PathRole, str]] getModulePathsAsStr(Module m, Modul ms.status[iname] = ms.status[iname] ? {}; try { mloc = getModuleLocation(iname, ms.pathConfig); - //if(mloc.extension != "rsc" || isModuleLocationInLibs(mloc, ms.pathConfig)) throw "No src or library module 2"; + //if(mloc.extension != "rsc" || isModuleLocationInLibs(iname, mloc, ms.pathConfig)) throw "No src or library module 2"; } catch str msg: { ms.messages[moduleName] ? [] += [ error(msg, imod@\loc) ]; ms.status[iname] += { rsc_not_found() }; @@ -332,6 +332,9 @@ rel[str,datetime,PathRole] makeBom(str qualifiedModuleName, set[str] imports, se + { }; } void updateBOM(str qualifiedModuleName, set[str] imports, set[str] extends, ModuleStatus ms){ + if(isModuleLocationInLibs(qualifiedModuleName, ms.moduleLocs[qualifiedModuleName], ms.pathConfig)){ + return; + } = getTModelForModule(qualifiedModuleName, ms); if(found){ newBom = makeBom(qualifiedModuleName, imports, extends, ms); @@ -451,6 +454,7 @@ ModuleStatus doSaveModule(set[str] component, map[str,set[str]] m_imports, map[s case loc l : if(!isEmpty(l.fragment)) insert l[fragment=""]; }; + m1.convertedToPhysical = false; ms.status[qualifiedModuleName] -= {tpl_saved()}; ms = addTModel(qualifiedModuleName, m1, ms); //println("doSaveModule"); iprintln(m1.logical2physical);