From 34fcd8b85af885a54321c32ac90b08d89a69ab63 Mon Sep 17 00:00:00 2001 From: paulklint Date: Wed, 19 Jun 2024 00:32:57 +0200 Subject: [PATCH] Next attempt at breaking the extend cycle in Checker --- .settings/org.eclipse.core.resources.prefs | 2 - .../lang/rascalcore/check/ADTandGrammar.rsc | 2 - .../library/lang/rascalcore/check/Checker.rsc | 2 +- .../lang/rascalcore/check/CheckerCommon.rsc | 253 ++++++++++++++++- .../library/lang/rascalcore/check/Import.rsc | 2 - .../lang/rascalcore/check/ModuleStatus.rsc | 256 ------------------ .../library/lang/rascalcore/check/Summary.rsc | 1 - .../lang/rascalcore/compile/Examples/Tst1.rsc | 35 +-- 8 files changed, 265 insertions(+), 288 deletions(-) delete mode 100644 src/org/rascalmpl/core/library/lang/rascalcore/check/ModuleStatus.rsc diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index 4e8aa177..7ec1b20e 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,7 +1,5 @@ eclipse.preferences.version=1 encoding//src/org/rascalmpl/core/library=UTF-8 -encoding//target/generated-test-resources=UTF-8 -encoding//target/generated-test-sources=UTF-8 encoding/=UTF-8 encoding/src=UTF-8 encoding/test=UTF-8 diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/check/ADTandGrammar.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/check/ADTandGrammar.rsc index c57a02cd..77eb2736 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/ADTandGrammar.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/ADTandGrammar.rsc @@ -10,8 +10,6 @@ extend lang::rascalcore::check::CheckerCommon; import lang::rascalcore::grammar::definition::Layout; import lang::rascalcore::grammar::definition::Keywords; - -import lang::rascalcore::check::ModuleStatus; import lang::rascal::\syntax::Rascal; 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 c109406a..1bf61471 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/Checker.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/Checker.rsc @@ -36,7 +36,7 @@ extend lang::rascalcore::check::Import; extend lang::rascalcore::check::RascalConfig; -extend lang::rascalcore::check::ModuleStatus; +extend lang::rascalcore::check::CheckerCommon; import lang::rascalcore::compile::CompileTimeError; import analysis::typepal::Exception; 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 051cd37a..917e63c0 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc @@ -3,6 +3,7 @@ module lang::rascalcore::check::CheckerCommon /* A convenience module that helps to break cycles in the import structure + Also introduces ModuleStatus that represents all the relevant information about currently processed modules. */ extend lang::rascalcore::check::CollectType; @@ -10,6 +11,23 @@ extend lang::rascalcore::check::ComputeType; extend lang::rascalcore::check::SyntaxGetters; extend analysis::typepal::FailMessage; +import analysis::typepal::Collector; + +import lang::rascal::\syntax::Rascal; +import DateTime; +import Exception; +import IO; +import List; +import ListRelation; +import Location; +import Map; +import Set; +import String; +import ValueIO; +import util::Reflective; + +import lang::rascalcore::compile::util::Names; // TODO: refactor, this is an undesired dependency on compile +import lang::rascalcore::compile::CompileTimeError; void checkSupportedByParserGenerator(Tree t, Collector c){ c.require("implemented by parsergenerator", t, [t], void(Solver s){ @@ -17,4 +35,237 @@ void checkSupportedByParserGenerator(Tree t, Collector c){ if(isNonParameterizedNonTerminalType(tp)) return; s.report(info(t, "%t is possibly not yet supported by parsergenerator", tp)); }); - } \ No newline at end of file + } + +data MStatus = + not_found() + | parsed() + | parse_error() + | module_dependencies_extracted() + | checked() + | check_error() + | code_generated() + | tpl_uptodate() + | tpl_saved() + | ignored() + ; + +data ModuleStatus = + moduleStatus( + rel[str, PathRole, str] strPaths, + rel[loc, PathRole, loc] paths, + map[str, Module] parseTrees, + list[str] parseTreeLIFO, + map[str, TModel] tmodels, + list[str] tmodelLIFO, + map[str,loc] moduleLocs, + map[str,datetime] moduleLastModified, + map[str, list[Message]] messages, + map[str, set[MStatus]] status, + PathConfig pathConfig + ); + +ModuleStatus newModuleStatus(PathConfig pcfg) = moduleStatus({}, {}, (), [], (), [], (), (), (), (), pcfg); + +bool traceTPL = false; +bool traceParseTreeCache = false; +bool traceTModelCache = false; + +tuple[bool,loc] getTPLReadLoc(str qualifiedModuleName, PathConfig pcfg){ + parts = split("::", qualifiedModuleName); + parts = parts[0 .. size(parts)-1] + "$"; + res = intercalate("/", parts); + fileName = intercalate("/", parts) + ".tpl"; + dirName = makeDirName(qualifiedModuleName); + + for(loc dir <- [pcfg.resources, pcfg.bin] + pcfg.libs){ // In a bin or lib directory? + fileLoc = dir + "" + fileName; + if(exists(fileLoc)){ + if(traceTPL) println("getTPLReadLoc: =\> "); + return ; + } else { + if(traceTPL) + println("getTPLReadLoc: DOES NOT EXIST: "); + } + } + return ; +} + +tuple[bool,loc] getTPLWriteLoc(str qualifiedModuleName, PathConfig pcfg){ + fileName = ".tpl"; + tplLoc = getDerivedResourcesDir(qualifiedModuleName, pcfg) + fileName; + return ; +} + +datetime getLastModified(str qualifiedModuleName, map[str, datetime] moduleLastModified, PathConfig pcfg){ + qualifiedModuleName = unescape(qualifiedModuleName); + try { + res = moduleLastModified[qualifiedModuleName]; + //println("getLastModified from map: "); + return res; + } catch NoSuchKey(_): { + try { + mloc = getModuleLocation(qualifiedModuleName, pcfg); + res = lastModified(mloc); + //println("getLastModified via lastModified: "); + return res; + } catch value _: { + return $2000-01-01T00:00:00.000+00:00$; + } + } +} + +int parseTreeCacheSize = 10; + +tuple[bool, Module, ModuleStatus] getModuleParseTree(str qualifiedModuleName, ModuleStatus ms){ + pcfg = ms.pathConfig; + if(ms.parseTrees[qualifiedModuleName]?){ + if(traceParseTreeCache) println("*** using cached parse tree for "); + return ; + } else { + if(!ms.status[qualifiedModuleName]?){ + ms.status[qualifiedModuleName] = {}; + } + if(parse_error() notin ms.status[qualifiedModuleName]){ + if(size(ms.parseTreeLIFO) >= parseTreeCacheSize){ + ms.parseTrees = delete(ms.parseTrees, ms.parseTreeLIFO[-1]); + if(traceParseTreeCache) println("*** deleting parse tree "); + ms.parseTreeLIFO = ms.parseTreeLIFO[..-1]; + } + ms.parseTreeLIFO = [qualifiedModuleName, *ms.parseTreeLIFO]; + mloc = |unknown:///|; + try { + mloc = getModuleLocation(qualifiedModuleName, pcfg); + } catch _: { + //ms.messages[qualifiedModuleName] ? [] = [error("Module not found", mloc)]; + //ms.status[qualifiedModuleName] += {not_found()}; + mpt = [Module] "module "; + //ms.parseTrees[qualifiedModuleName] = mpt; + ms.moduleLocs[qualifiedModuleName] = mloc; + return ; + } + if(traceParseTreeCache) println("*** parsing from "); + try { + pt = parseModuleWithSpaces(mloc).top; + ms.parseTrees[qualifiedModuleName] = pt; + ms.moduleLocs[qualifiedModuleName] = getLoc(pt); + ms.status[qualifiedModuleName] += parsed(); + return ; + } catch _: {//ParseError(loc src): { + ms.messages[qualifiedModuleName] ? [] = [error("Parse error in ", mloc)]; + ms.moduleLocs[qualifiedModuleName] = mloc; + ms.status[qualifiedModuleName] += parse_error(); + return ", ms>; + } + } + mpt = [Module] "module "; + ms.parseTrees[qualifiedModuleName] = mpt; + return ; + } +} + +set[str] hardwired = {}; + +int tmodelCacheSize = 4; // should be > 0 + +int maxHardwired = tmodelCacheSize/4; + +void analyzeTModels(ModuleStatus ms){ + freq = (); + total = 0; + for(<_, _, m2> <- ms.strPaths){ + freq[m2] ? 0 += 1; + total += 1; + } + sorted_freq = sort(toList(freq), bool(tuple[str s,int n] a, tuple[str s, int n] b){ return a.n > b.n; }); + nmodules = size(freq); + cutoff = 2 * total/(nmodules + 1); + hardwire = [tp | tuple[str s, int n] tp <- sorted_freq , tp.n > cutoff][0..maxHardwired]; + if(traceTModelCache){ + println("analyzeTModels: modules, imports/extends: , cutoff: "); + iprintln(hardwire); + } + hardwired = toSet(domain(hardwire)); +} + +ModuleStatus addTModel (str qualifiedModuleName, TModel tm, ModuleStatus ms){ + if(traceTModelCache) println("addTModel: "); + if(tmodelCacheSize > 0){ + if(tpl_saved() notin ms.status[qualifiedModuleName]){ + iprintln(ms.status); + throw "Cannot add module with unsaved tpl"; + } + ms.tmodels[qualifiedModuleName] = tm; + if(qualifiedModuleName notin hardwired){ + if(qualifiedModuleName notin ms.tmodelLIFO){ + ms.tmodelLIFO = [qualifiedModuleName, *ms.tmodelLIFO]; + while(size(ms.tmodels) >= tmodelCacheSize && size(ms.tmodelLIFO) > 0 && ms.tmodelLIFO[-1] != qualifiedModuleName){ + if(tpl_saved() notin ms.status[ms.tmodelLIFO[-1]]){ + iprintln(ms.status); + throw "Cannot remove unsaved tpl , "; + } + ms.tmodels = delete(ms.tmodels, ms.tmodelLIFO[-1]); + if(traceTModelCache) println("*** deleting tmodel , tmodels: , lifo: "); + ms.tmodelLIFO = ms.tmodelLIFO[..-1]; + } + } + } + } + return ms; +} + +tuple[bool, TModel, ModuleStatus] getTModelForModule(str qualifiedModuleName, ModuleStatus ms){ + if(traceTModelCache) println("getTModelForModule: "); + pcfg = ms.pathConfig; + if(ms.tmodels[qualifiedModuleName]?){ + if(tpl_saved() notin ms.status[qualifiedModuleName]){ + throw "Unsaved tmodel for in cache"; + } + return ; + } + while(size(ms.tmodels) >= tmodelCacheSize && size(ms.tmodelLIFO) > 0 && ms.tmodelLIFO[-1] != qualifiedModuleName){ + ms.tmodels = delete(ms.tmodels, ms.tmodelLIFO[-1]); + if(traceTModelCache) println("*** deleting tmodel , tmodels: , lifo: "); + ms.tmodelLIFO = ms.tmodelLIFO[..-1]; + } + + = getTPLReadLoc(qualifiedModuleName, pcfg); + if(found){ + if(traceTPL) println("*** reading tmodel "); + try { + tpl = readBinaryValueFile(#TModel, tplLoc); + if(tpl.rascalTplVersion? && isValidRascalTplVersion(tpl.rascalTplVersion)){ + tpl = convertTModel2PhysicalLocs(tpl); + + ms.tmodels[qualifiedModuleName] = tpl; + ms.status[qualifiedModuleName] += {tpl_uptodate(), tpl_saved()}; + if(qualifiedModuleName notin hardwired){ + ms.tmodelLIFO = [qualifiedModuleName, *ms.tmodelLIFO]; + } + return ; + } + //else { + // msg = " has outdated or missing Rascal TPL version (required: )"; + // println("INFO: )"); + // throw rascalTplVersionError(msg); + // //ms.tmodels[qualifiedModuleName] = + // // tmodel(modelName=qualifiedModuleName, + // // messages=[msg]); + // //return ; + //} + } catch e: { + //ms.status[qualifiedModuleName] ? {} += not_found(); + return : ", tplLoc)]), ms>; + //throw IO("Cannot read tpl for : "); + } + msg = " has outdated or missing Rascal TPL version (required: )"; + println("INFO: )"); + throw rascalTplVersionError(msg); + } + //if(qualifiedModuleName notin hardwired){ + // ms.tmodelLIFO = ms.tmodelLIFO[1..]; + //} + //ms.status[qualifiedModuleName] ? {} += not_found(); + return ", |unknown:///|)]), ms>; + // throw IO("Cannot read tpl for "); +} \ No newline at end of file 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 ddff1937..5ff5e436 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc @@ -3,7 +3,6 @@ module lang::rascalcore::check::Import /* Check imports, and read/write TPL files. - Introduces ModuleStatus that represents all the relevant information about currently processed modules. */ extend lang::rascalcore::check::CheckerCommon; @@ -12,7 +11,6 @@ import lang::rascalcore::check::RascalConfig; import lang::rascal::\syntax::Rascal; import lang::rascalcore::check::ADTandGrammar; -import lang::rascalcore::check::ModuleStatus; import DateTime; import Exception; diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/check/ModuleStatus.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/check/ModuleStatus.rsc deleted file mode 100644 index 2bccf062..00000000 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/ModuleStatus.rsc +++ /dev/null @@ -1,256 +0,0 @@ -module lang::rascalcore::check::ModuleStatus - -extend lang::rascalcore::check::CheckerCommon; - -import lang::rascalcore::check::RascalConfig; - -import analysis::typepal::Collector; - -import lang::rascal::\syntax::Rascal; -import DateTime; -import Exception; -import IO; -import List; -import ListRelation; -import Location; -import Map; -import Set; -import String; -import ValueIO; -import util::Reflective; - -import lang::rascalcore::compile::util::Names; // TODO: refactor, this is an undesired dependency on compile -import lang::rascalcore::compile::CompileTimeError; - -data MStatus = - not_found() - | parsed() - | parse_error() - | module_dependencies_extracted() - | checked() - | check_error() - | code_generated() - | tpl_uptodate() - | tpl_saved() - | ignored() - ; - -data ModuleStatus = - moduleStatus( - rel[str, PathRole, str] strPaths, - rel[loc, PathRole, loc] paths, - map[str, Module] parseTrees, - list[str] parseTreeLIFO, - map[str, TModel] tmodels, - list[str] tmodelLIFO, - map[str,loc] moduleLocs, - map[str,datetime] moduleLastModified, - map[str, list[Message]] messages, - map[str, set[MStatus]] status, - PathConfig pathConfig - ); - -ModuleStatus newModuleStatus(PathConfig pcfg) = moduleStatus({}, {}, (), [], (), [], (), (), (), (), pcfg); - -bool traceTPL = false; -bool traceParseTreeCache = false; -bool traceTModelCache = false; - -tuple[bool,loc] getTPLReadLoc(str qualifiedModuleName, PathConfig pcfg){ - parts = split("::", qualifiedModuleName); - parts = parts[0 .. size(parts)-1] + "$"; - res = intercalate("/", parts); - fileName = intercalate("/", parts) + ".tpl"; - dirName = makeDirName(qualifiedModuleName); - - for(loc dir <- [pcfg.resources, pcfg.bin] + pcfg.libs){ // In a bin or lib directory? - fileLoc = dir + "" + fileName; - if(exists(fileLoc)){ - if(traceTPL) println("getTPLReadLoc: =\> "); - return ; - } else { - if(traceTPL) - println("getTPLReadLoc: DOES NOT EXIST: "); - } - } - return ; -} - -tuple[bool,loc] getTPLWriteLoc(str qualifiedModuleName, PathConfig pcfg){ - fileName = ".tpl"; - tplLoc = getDerivedResourcesDir(qualifiedModuleName, pcfg) + fileName; - return ; -} - -datetime getLastModified(str qualifiedModuleName, map[str, datetime] moduleLastModified, PathConfig pcfg){ - qualifiedModuleName = unescape(qualifiedModuleName); - try { - res = moduleLastModified[qualifiedModuleName]; - //println("getLastModified from map: "); - return res; - } catch NoSuchKey(_): { - try { - mloc = getModuleLocation(qualifiedModuleName, pcfg); - res = lastModified(mloc); - //println("getLastModified via lastModified: "); - return res; - } catch value _: { - return $2000-01-01T00:00:00.000+00:00$; - } - } -} - -int parseTreeCacheSize = 10; - -tuple[bool, Module, ModuleStatus] getModuleParseTree(str qualifiedModuleName, ModuleStatus ms){ - pcfg = ms.pathConfig; - if(ms.parseTrees[qualifiedModuleName]?){ - if(traceParseTreeCache) println("*** using cached parse tree for "); - return ; - } else { - if(!ms.status[qualifiedModuleName]?){ - ms.status[qualifiedModuleName] = {}; - } - if(parse_error() notin ms.status[qualifiedModuleName]){ - if(size(ms.parseTreeLIFO) >= parseTreeCacheSize){ - ms.parseTrees = delete(ms.parseTrees, ms.parseTreeLIFO[-1]); - if(traceParseTreeCache) println("*** deleting parse tree "); - ms.parseTreeLIFO = ms.parseTreeLIFO[..-1]; - } - ms.parseTreeLIFO = [qualifiedModuleName, *ms.parseTreeLIFO]; - mloc = |unknown:///|; - try { - mloc = getModuleLocation(qualifiedModuleName, pcfg); - } catch _: { - //ms.messages[qualifiedModuleName] ? [] = [error("Module not found", mloc)]; - //ms.status[qualifiedModuleName] += {not_found()}; - mpt = [Module] "module "; - //ms.parseTrees[qualifiedModuleName] = mpt; - ms.moduleLocs[qualifiedModuleName] = mloc; - return ; - } - if(traceParseTreeCache) println("*** parsing from "); - try { - pt = parseModuleWithSpaces(mloc).top; - ms.parseTrees[qualifiedModuleName] = pt; - ms.moduleLocs[qualifiedModuleName] = getLoc(pt); - ms.status[qualifiedModuleName] += parsed(); - return ; - } catch _: {//ParseError(loc src): { - ms.messages[qualifiedModuleName] ? [] = [error("Parse error in ", mloc)]; - ms.moduleLocs[qualifiedModuleName] = mloc; - ms.status[qualifiedModuleName] += parse_error(); - return ", ms>; - } - } - mpt = [Module] "module "; - ms.parseTrees[qualifiedModuleName] = mpt; - return ; - } -} - -set[str] hardwired = {}; - -int tmodelCacheSize = 4; // should be > 0 - -int maxHardwired = tmodelCacheSize/4; - -void analyzeTModels(ModuleStatus ms){ - freq = (); - total = 0; - for(<_, _, m2> <- ms.strPaths){ - freq[m2] ? 0 += 1; - total += 1; - } - sorted_freq = sort(toList(freq), bool(tuple[str s,int n] a, tuple[str s, int n] b){ return a.n > b.n; }); - nmodules = size(freq); - cutoff = 2 * total/(nmodules + 1); - hardwire = [tp | tuple[str s, int n] tp <- sorted_freq , tp.n > cutoff][0..maxHardwired]; - if(traceTModelCache){ - println("analyzeTModels: modules, imports/extends: , cutoff: "); - iprintln(hardwire); - } - hardwired = toSet(domain(hardwire)); -} - -ModuleStatus addTModel (str qualifiedModuleName, TModel tm, ModuleStatus ms){ - if(traceTModelCache) println("addTModel: "); - if(tmodelCacheSize > 0){ - if(tpl_saved() notin ms.status[qualifiedModuleName]){ - iprintln(ms.status); - throw "Cannot add module with unsaved tpl"; - } - ms.tmodels[qualifiedModuleName] = tm; - if(qualifiedModuleName notin hardwired){ - if(qualifiedModuleName notin ms.tmodelLIFO){ - ms.tmodelLIFO = [qualifiedModuleName, *ms.tmodelLIFO]; - while(size(ms.tmodels) >= tmodelCacheSize && size(ms.tmodelLIFO) > 0 && ms.tmodelLIFO[-1] != qualifiedModuleName){ - if(tpl_saved() notin ms.status[ms.tmodelLIFO[-1]]){ - iprintln(ms.status); - throw "Cannot remove unsaved tpl , "; - } - ms.tmodels = delete(ms.tmodels, ms.tmodelLIFO[-1]); - if(traceTModelCache) println("*** deleting tmodel , tmodels: , lifo: "); - ms.tmodelLIFO = ms.tmodelLIFO[..-1]; - } - } - } - } - return ms; -} - -tuple[bool, TModel, ModuleStatus] getTModelForModule(str qualifiedModuleName, ModuleStatus ms){ - if(traceTModelCache) println("getTModelForModule: "); - pcfg = ms.pathConfig; - if(ms.tmodels[qualifiedModuleName]?){ - if(tpl_saved() notin ms.status[qualifiedModuleName]){ - throw "Unsaved tmodel for in cache"; - } - return ; - } - while(size(ms.tmodels) >= tmodelCacheSize && size(ms.tmodelLIFO) > 0 && ms.tmodelLIFO[-1] != qualifiedModuleName){ - ms.tmodels = delete(ms.tmodels, ms.tmodelLIFO[-1]); - if(traceTModelCache) println("*** deleting tmodel , tmodels: , lifo: "); - ms.tmodelLIFO = ms.tmodelLIFO[..-1]; - } - - = getTPLReadLoc(qualifiedModuleName, pcfg); - if(found){ - if(traceTPL) println("*** reading tmodel "); - try { - tpl = readBinaryValueFile(#TModel, tplLoc); - if(tpl.rascalTplVersion? && isValidRascalTplVersion(tpl.rascalTplVersion)){ - tpl = convertTModel2PhysicalLocs(tpl); - - ms.tmodels[qualifiedModuleName] = tpl; - ms.status[qualifiedModuleName] += {tpl_uptodate(), tpl_saved()}; - if(qualifiedModuleName notin hardwired){ - ms.tmodelLIFO = [qualifiedModuleName, *ms.tmodelLIFO]; - } - return ; - } - //else { - // msg = " has outdated or missing Rascal TPL version (required: )"; - // println("INFO: )"); - // throw rascalTplVersionError(msg); - // //ms.tmodels[qualifiedModuleName] = - // // tmodel(modelName=qualifiedModuleName, - // // messages=[msg]); - // //return ; - //} - } catch e: { - //ms.status[qualifiedModuleName] ? {} += not_found(); - return : ", tplLoc)]), ms>; - //throw IO("Cannot read tpl for : "); - } - msg = " has outdated or missing Rascal TPL version (required: )"; - println("INFO: )"); - throw rascalTplVersionError(msg); - } - //if(qualifiedModuleName notin hardwired){ - // ms.tmodelLIFO = ms.tmodelLIFO[1..]; - //} - //ms.status[qualifiedModuleName] ? {} += not_found(); - return ", |unknown:///|)]), ms>; - // throw IO("Cannot read tpl for "); -} \ No newline at end of file diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/check/Summary.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/check/Summary.rsc index 16eb90a2..b672a537 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/Summary.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/Summary.rsc @@ -8,7 +8,6 @@ module lang::rascalcore::check::Summary extend lang::rascalcore::check::CheckerCommon; -import lang::rascalcore::check::ModuleStatus; import lang::rascalcore::check::Import; import analysis::typepal::TModel; diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst1.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst1.rsc index e6547709..42c1683b 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst1.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst1.rsc @@ -6,30 +6,19 @@ import util::Benchmark; void main() { start_time = cpuTime(); - input_module = "lang::rascal::tutor::Tst"; - pcfg = pathConfig( - ignores=[], - resources=|file:///Users/paulklint/git/rascal-tutor/target/classes/|, - javaCompilerPath=[], - bin=|file:///Users/paulklint/git/rascal-tutor/target/classes/|, - classloaders=[], - generatedSources=|file:///Users/paulklint/git/rascal-tutor/generated-sources/|, - // libs=[|lib://rascal|], - libs=[|jar+file:///Users/paulklint/.m2/repository/org/rascalmpl/rascal/0.39.5-BOOT2/rascal-0.39.5-BOOT2.jar!|], - - srcs=[|file:///Users/paulklint/git/rascal-tutor/src/|]); + input_module = "lang::rascalcore::compile::Compile"; - //pcfg = pathConfig( - // bin=|project://rascal-core/target/generated-test-sources2|, - // generatedSources=|project://rascal-core/target/generated-test-sources2|, - // resources = |project://rascal-core/target/generated-test-resources2|, - // srcs=[ //|project://rascal/src/org/rascalmpl/library|, - // //|std:///|, - // |project://rascal-core/src/org/rascalmpl/core/library|, - // |project://typepal/src|, - // |project://rascal-tutor/src|], - // libs=[|jar+file:///Users/paulklint/.m2/repository/org/rascalmpl/rascal/0.39.5-BOOT2/rascal-0.39.5-BOOT2.jar!|] - // ); + pcfg = pathConfig( + bin=|project://rascal-core/target/generated-test-sources2|, + generatedSources=|project://rascal-core/target/generated-test-sources2|, + resources = |project://rascal-core/target/generated-test-resources2|, + srcs=[ //|project://rascal/src/org/rascalmpl/library|, + //|std:///|, + |project://rascal-core/src/org/rascalmpl/core/library|, + |project://typepal/src|, + |project://rascal-tutor/src|], + libs=[|jar+file:///Users/paulklint/.m2/repository/org/rascalmpl/rascal/0.39.5-BOOT2/rascal-0.39.5-BOOT2.jar!|] + ); ModuleStatus result = rascalTModelForNames([input_module], rascalCompilerConfig(pcfg), dummy_compile1