Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d69c2ac
Added test for #2455
rodinaarssen Oct 15, 2025
1733ecf
Merge branch 'main' into test-for-2455
PaulKlint Oct 15, 2025
c2dc49f
Moved md5 field to TypePal
PaulKlint Oct 20, 2025
263316d
Call newCollector with timestamp field
PaulKlint Oct 20, 2025
e82bf2e
Commented out body of path consolidation
PaulKlint Oct 20, 2025
60f01a4
Take care of module locs without coordinates
PaulKlint Oct 20, 2025
47bb97f
Duplicate DefInfo declaration
PaulKlint Oct 21, 2025
1a9eef6
Fixed syntax error
PaulKlint Oct 21, 2025
4c50777
Ignored test with uncertain outcome
PaulKlint Oct 21, 2025
efe4e93
Fixed type errors
PaulKlint Oct 21, 2025
3fa507a
Bumped to typepal-0.15.2-RC17
PaulKlint Oct 21, 2025
bd0c0fe
Commented out debug prints
PaulKlint Oct 22, 2025
9adca5c
Changed signature of createLogicalLoc to reflect whether a logical lo…
PaulKlint Oct 22, 2025
9856534
Updated to 0.15.2-RC19
PaulKlint Oct 22, 2025
ada3f8b
Added `import lang::rascalcore::check::BasicRascalConfig;` to make `p…
PaulKlint Oct 22, 2025
22b0d74
Changed imports to extends trying to combat the behaviour of the inte…
PaulKlint Oct 22, 2025
e08c7cd
Hack to potentially circumvent interpreter issue
PaulKlint Oct 24, 2025
c14c196
Updated to typepal-0.15.2-RC19
PaulKlint Oct 25, 2025
6737068
Commented out duplicate DefInfo def. Added ("redundant") extend of an…
PaulKlint Oct 25, 2025
d8ab9f7
Merge branch 'main' into fix/mixed-rascal-versions
PaulKlint Oct 25, 2025
487dc4c
Merge branch 'main' into fix/mixed-rascal-versions
DavyLandman Oct 29, 2025
070f049
Reverting changes made for debugging
PaulKlint Oct 29, 2025
38c95c1
Merge branch 'main' into fix/mixed-rascal-versions
PaulKlint Oct 29, 2025
645f7e9
Merge branch 'main' into fix/mixed-rascal-versions
DavyLandman Oct 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@
<dependency>
<groupId>org.rascalmpl</groupId>
<artifactId>typepal</artifactId>
<version>0.15.2-RC16</version>
<version>0.15.2-RC19</version>
<!-- <scope>provided</scope> for shade plugin it can't be provided. At least the rascal dependency in typepal should be provided -->
<scope>compile</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ extend lang::rascalcore::check::ATypeBase;
import String;
import List;

//data AType;
data ACharRange = \empty-range();

ACharRange \new-range(int from, int to) = from <= to ? arange(from, to) : \empty-range();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ data DefInfo(map[str,str] tags = ());
// Function modifiers
data DefInfo(list[str] modifiers = []);

// Function md5Hash of source
data DefInfo(str md5 = "");

// Common Keyword fields for ADTs
data DefInfo(list[KeywordFormal] commonKeywordFields = []);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ tuple[TModel, ModuleStatus] rascalTModelComponent(set[str] moduleNames, ModuleSt

start_check = cpuTime();
resetClosureCounter();
c = newCollector(modelName, namedTrees, compilerConfig);
c = newCollector(modelName, namedTrees, compilerConfig, timestamp = getLastModified(modelName, ms.moduleLastModified, pcfg));
c.push(key_pathconfig, pcfg);

rascalPreCollectInitialization(namedTrees, c);
Expand Down
38 changes: 20 additions & 18 deletions src/org/rascalmpl/compiler/lang/rascalcore/check/CheckerCommon.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -431,24 +431,26 @@ ModuleStatus updatePaths(loc oldModuleLoc, loc newModuleLoc, ModuleStatus ms){
}

ModuleStatus consolidatePaths(ModuleStatus ms){
set[loc] locs = {lc| /loc lc := ms.paths};
map[loc,loc] lprops = ();
rel[loc,PathRole,loc] paths = ms.paths;
for(loc l <- locs){
if(l.top in lprops && loc r := lprops[l.top] && r != l){
if(l.length? && !r.length?){
paths = visit(paths) { case r: { insert l; }};
} else if(!l.length? && r.length?){
paths = visit(paths) { case l: { insert r; }};
} else {
mname = getRascalModuleName(l, ms.pathConfig);
causes = [info("Module location for <mname>: <x>", x) | x <- [l, r]];
ms.messages[mname] ? {} += { error("Conflicting module locations found for <mname>", l, causes=causes) };
}
}
lprops[l.top] = l;
}
ms.paths = paths;
// set[loc] locs = {lc| /loc lc := ms.paths};
// map[loc,loc] lprops = ();
// rel[loc,PathRole,loc] paths = ms.paths;
// for(loc l <- locs){
// if(l.top in lprops && loc r := lprops[l.top] && r != l){
// if(l.length? && !r.length?){
// paths = visit(paths) { case r: { insert l; }};
// } else if(!l.length? && r.length?){
// paths = visit(paths) { case l: { insert r; }};
// } else {
// paths = visit(paths) { case l: { insert l.top; }};
// // mname = getRascalModuleName(l, ms.pathConfig);
// // causes = [info("Module location for <mname>: <x>", x) | x <- [l, r]];
// // ms.messages[mname] ? {} += { error("Conflicting module locations found for <mname>", l, causes=causes) };
// }
// }
// lprops[l.top] = l;
// }
// ms.paths = paths;
//ms.paths = visit(ms.paths) { case loc l => l.top };

// strPaths = getStrPaths(ms.paths, ms.pathConfig);
// if(strPaths != ms.strPaths){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import lang::rascalcore::agrammar::definition::Attributes;
import lang::rascalcore::check::SyntaxGetters;

import lang::rascalcore::check::ATypeBase; // seemingly redundant
extend lang::rascalcore::check::BasicRascalConfig;

import IO;
import List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import util::Maybe;
import lang::rascalcore::agrammar::definition::Symbols;
import lang::rascalcore::agrammar::definition::Attributes;
import lang::rascalcore::check::ATypeBase; // seemingly redundant
extend lang::rascalcore::check::BasicRascalConfig;

// ---- syntax definition -----------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ module lang::rascalcore::check::RascalConfig
High level configuration of the Rascal checker.
*/

//import lang::rascalcore::check::CheckerCommon;

import lang::rascalcore::check::ADTandGrammar;
import lang::rascalcore::compile::muRascal::AST;

Expand Down Expand Up @@ -529,19 +527,19 @@ void rascalPostSolver(map[str,Tree] namedTrees, Solver s){
// bool isLogicalLoc(loc l)
// = startsWith(l.scheme, "rascal+");

loc rascalCreateLogicalLoc(Define def, str _modelName, PathConfig pcfg){
tuple[bool, loc] rascalCreateLogicalLoc(Define def, str _modelName, PathConfig pcfg){
if(def.idRole in keepInTModelRoles){
if(isLogicalLoc(def.defined)) return def.defined;
moduleName = getRascalModuleName(def.defined, pcfg);
moduleNameSlashed = replaceAll(moduleName, "::", "/");
suffix = def.defInfo.md5? ? "$<def.defInfo.md5[0..16]>" : "";
if(def.idRole == moduleId()){
return |<"rascal+<prettyRole(def.idRole)>">:///<moduleNameSlashed><suffix>|;
return <true, |<"rascal+<prettyRole(def.idRole)>">:///<moduleNameSlashed><suffix>|>;
} else {
return |<"rascal+<prettyRole(def.idRole)>">:///<moduleNameSlashed>/<reduceToURIChars(def.id)><suffix>|;
return <true, |<"rascal+<prettyRole(def.idRole)>">:///<moduleNameSlashed>/<reduceToURIChars(def.id)><suffix>|>;
}
}
return def.defined;
return <false, def.defined>;
}

@memo{expireAfter(minutes=5),maximumSize(1000)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ public loc RASCAL = |mvn://org.rascalmpl--rascal--0.41.0-RC15/|;
public loc TYPEPAL = |mvn://org.rascalmpl--typepal--0.14.8/|;
public loc OUTDATED_TYPEPAL
= |mvn://org.rascalmpl--typepal--0.14.1/|;
public loc RASCAL_RC67 = |mvn://org.rascalmpl--rascal--0.41.0-RC67/|;

public loc DRAMBIGUITY = |mvn://org.rascalmpl--drambiguity--0.1.2/|;
public loc FLYBYTES = |mvn://org.rascalmpl--flybytes--0.1.5/|;
public loc SALIX_CORE = |mvn://org.rascalmpl--salix-core--0.2.7/|;
public loc SALIX_CONTRIB = |mvn://org.rascalmpl--salix-contrib--0.2.7/|;
public loc RASCAL_LSP = |mvn://org.rascalmpl--rascal-lsp--2.21.2/|;
public loc PHP_ANALYSIS = |mvn://org.rascalmpl--php-analysis--0.2.5-SNAPSHOT/|;
public loc JAVA_AIR = |mvn://org.rascalmpl--java-air--1.0.0-RC2/|;

public loc REPO = |file:///Users/paulklint/git/|;
public loc COMPILED_RASCAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,27 @@ test bool incompatibleVersionsOfBinaryLibrary(){
// Recompile Check and discover the error
return checkExpectErrors("Check", ["Review of dependencies, reconfiguration or recompilation needed: binary module `TP` depends (indirectly) on incompatible module(s)"], core.pcfg, remove = [rascal, typepal, core]);
}
@ignore{Unclear whether it should fail or succeed}
test bool mixedRascalVersions() {
// This test project has a dependency on:
// * Rascal 0.41.0-RC67
// * java-air 1.0.0-RC2, which was built using Rascal 0.41.0-RC35
// The test module imports:
// * a standard library module from 0.41.0-RC67
// * a library module of which the packaged tpl was built using 0.41.0-RC35
clearMemory();
project_name = "test-project";
test_project =
createProject(
project_name,
("Test": "import IO;
'import lang::java::m3::Core;"),
createPathConfig(project_name)
[libs=[RASCAL_RC67, JAVA_AIR]]
[srcs=[src(project_name)]]
);
return checkExpectNoErrors("Test", test_project.pcfg, remove = [test_project]);
}

// ---- Binary compatibility of two TModels -----------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,17 @@ bool validateUseDefs(str moduleName, map[str, tuple[int, set[int]]] usedefs, Mod
println("names:"); iprintln(names);
<found, tm, ms> = getTModelForModule(moduleName, ms);
foundUseDefs = tm.useDef;
println("foundUseDefs:");
for(<u, d> <- foundUseDefs){
println("<readFile(u)>:<u> ==\> <d>");
}
// println("foundUseDefs:");
// for(<u, d> <- foundUseDefs){
// println("<readFile(u)>:<u> ==\> <d>");
// }
for(str v <- usedefs){
<def, uses> = usedefs[v];
list[loc] occ = [];
if(names[v]?) occ = names[v]; else throw "<v> not found in tree";
if(!occ[def]?) throw "Missing define <def> for <v>";
for(int u <- uses){
println("u = <u>");
//println("u = <u>");
if(!occ[u]?){
throw "Missing use <u> for <v>";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ function download() {

# these should be synced with `TestConfigs.rsc`
download "org.rascalmpl" "rascal" "0.41.0-RC15"
download "org.rascalmpl" "rascal" "0.41.0-RC67"
download "org.rascalmpl" "typepal" "0.14.8"
download "org.rascalmpl" "typepal" "0.14.1"
download "org.rascalmpl" "drambiguity" "0.1.2"
download "org.rascalmpl" "flybytes" "0.1.5"
download "org.rascalmpl" "salix-core" "0.2.7"
download "org.rascalmpl" "salix-contrib" "0.2.7"
download "org.rascalmpl" "rascal-lsp" "2.21.2"
download "org.rascalmpl" "rascal-lsp" "2.21.2"
download "org.rascalmpl" "java-air" "1.0.0-RC2"
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ JGenie makeJGenie(MuModule m,

map[str,loc] allModuleLocs = moduleLocs;
map[loc,str] allLocs2Module = invertUnique(moduleLocs);
allLocs2Module += (l.top : allLocs2Module[l] | l <- domain(allLocs2Module) );
MuModule currentModule = m;
str moduleName = m.name;
map[AType, map[str,AType]] commonKeywordFieldsNameAndType = m.commonKeywordFields;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ public set[set[Define]] mygroup(set[Define] input, bool (Define a, Define b) sim
str generateResolvers(str moduleName, map[loc, MuFunction] loc2muFunction, set[str] imports, set[str] extends, map[str,TModel] tmodels, map[str,loc] module2loc, PathConfig pcfg, JGenie jg){
module_scope = module2loc[moduleName];

loc2module = invertUnique(module2loc);
module_scopes = domain(loc2module);
map[loc,str] loc2module = invertUnique(module2loc);
set[loc] module_scopes = domain(loc2module);
extend_scopes = { module2loc[ext] | ext <- extends, ext in module2loc};
import_scopes = { module2loc[imp] | imp <- imports, imp in module2loc };

Expand Down Expand Up @@ -376,7 +376,7 @@ str generateResolver(str moduleName, str functionName, set[Define] fun_defs, map
map[int, lrel[str,str]] overload_table = ();
lrel[str,str] defaults_and_constructors = [];

physical2logical = invertUnique(tm.logical2physical);
map[loc,loc] physical2logical = invertUnique(tm.logical2physical);

// Handle a function or constructor defintion

Expand Down