Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 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
652f461
Changed signature of rascalCreateLogicalLoc
PaulKlint Nov 17, 2025
9d51426
Added tests for private/public double declarations of module variables
PaulKlint Nov 17, 2025
f8bb8b8
Fixed type errors
PaulKlint Nov 17, 2025
2f332c5
Added type info
PaulKlint Nov 17, 2025
029466d
Fixed type error
PaulKlint Nov 17, 2025
e6e9ab3
Fixed overloading
PaulKlint Nov 17, 2025
d86b4cd
Avoid name clashes
PaulKlint Nov 17, 2025
fc74389
Declared local variable
PaulKlint Nov 17, 2025
901ae94
Avoided name clash
PaulKlint Nov 17, 2025
852dfa8
Fixed qualified name
PaulKlint Nov 17, 2025
376a445
Removed no longer needed files
PaulKlint Nov 17, 2025
3fbfa96
Merge branch 'main' into fix/mixed-rascal-versions
PaulKlint Nov 17, 2025
0e71fb5
Fixed type error and incorrect keyword parameter
PaulKlint Nov 18, 2025
8b016e9
Renamed module var
PaulKlint Nov 18, 2025
589afa1
Resolved ambiguous constructor
PaulKlint Nov 18, 2025
31b8066
Added type info in various places
PaulKlint Nov 19, 2025
c69f264
Merge branch 'main' into fix/mixed-rascal-versions
PaulKlint Nov 19, 2025
fba02ba
Fixed space in mnessage
PaulKlint Nov 19, 2025
1e239c6
Fixed salix config
PaulKlint Nov 19, 2025
bc1f6c6
Fixex outdated salix config
PaulKlint Nov 24, 2025
fbba578
New test scenario
PaulKlint Nov 24, 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 @@ -457,7 +457,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
4 changes: 2 additions & 2 deletions src/org/rascalmpl/compiler/BreakingChanges.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import util::FileSystem;
import lang::rascalcore::check::RascalConfig;
import analysis::typepal::TModel;

map[loc,loc] breaking(TModel old, TModel new){
map[loc,loc] breakingTModel(TModel old, TModel new){
missing = domain(old.logical2physical) - domain(new.logical2physical);
return domainR(old.logical2physical, missing);
}
Expand Down Expand Up @@ -53,7 +53,7 @@ void breaking(loc old, loc new, set[str] details = {}){
tmOld = readBinaryValueFile(#TModel, old + oldPath);
if(exists(new + oldPath)){
tmNew = readBinaryValueFile(#TModel, new + oldPath);
b = breaking(tmOld, tmNew);
b = breakingTModel(tmOld, tmNew);
if(!isEmpty(b)){
nchanges += size(b);
println("- <oldPath> <size(b)> changes");
Expand Down
14 changes: 7 additions & 7 deletions src/org/rascalmpl/compiler/CheckTestSources.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void main() = checkTestSources([]);
// otherwise only standard library and test files (~200 files)
void main(list[str] cmdLineArgs) = checkTestSources(cmdLineArgs);

loc REPO = |file:///Users/paulklint/git/|;
loc GIT_REPO = |file:///Users/paulklint/git/|;

list[str] getRascalModules(loc rootFolder, PathConfig pcfg)
= [ getModuleName(file, pcfg)
Expand All @@ -63,20 +63,20 @@ void checkTestSources(list[str] cmdLineArgs) {
list[str] modulesToCheck = [];
pcfg = getAllSrcREPOPathConfig(keep=true);
if("all" in cmdLineArgs){
modulesToCheck = getRascalModules(REPO + "rascal/src/org/rascalmpl/library", pcfg);
modulesToCheck = getRascalModules(GIT_REPO + "rascal/src/org/rascalmpl/library", pcfg);
} else {
testFolders = [ //|std:///lang/rascal/tests|,
//REPO + "/rascal-core/lang/rascalcore/check::tests",
REPO + "/typepal/src/"
//GIT_REPO + "/rascal-core/lang/rascalcore/check::tests",
GIT_REPO + "/typepal/src/"
];
modulesToCheck = [ *getRascalModules(testFolder, pcfg)
| testFolder <- testFolders
];
}

ignored = ["lang::rascal::tests::concrete::Patterns3" // takes too long
ignoredFiles = ["lang::rascal::tests::concrete::Patterns3" // takes too long
];
modulesToCheck -= ignored;
modulesToCheck -= ignoredFiles;

list[str] exceptions = [];
int n = size(modulesToCheck);
Expand All @@ -91,7 +91,7 @@ void checkTestSources(list[str] cmdLineArgs) {
}
println("Checked <n> test modules");
println("<size(exceptions)> failed to check: <exceptions>");
if(!isEmpty(ignored)) { println("Ignored: <ignored>"); }
if(!isEmpty(ignoredFiles)) { println("Ignored: <ignoredFiles>"); }
secs = total/1000000000;
println("Time: <secs> seconds");
}
Expand Down
14 changes: 7 additions & 7 deletions src/org/rascalmpl/compiler/CompileTestSources.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ import util::FileSystem;
import util::Benchmark;
import lang::rascalcore::compile::util::Names;

loc REPO = |file:///Users/paulklint/git/|;
loc GIT_REPO = |file:///Users/paulklint/git/|;

PathConfig manualTestConfig= pathConfig(bin= REPO + "generated-sources/target/classes",
generatedSources = REPO + "generated-sources/target/generated-sources",
generatedResources = REPO + "generated-sources/target/classes" //|project://rascal-core/target/generated-test-resources|
PathConfig manualTestConfig= pathConfig(bin= GIT_REPO + "generated-sources/target/classes",
generatedSources = GIT_REPO + "generated-sources/target/generated-sources",
generatedResources = GIT_REPO + "generated-sources/target/classes" //|project://rascal-core/target/generated-test-resources|
);
void main() = compileTestSources(manualTestConfig);

Expand Down Expand Up @@ -150,9 +150,9 @@ void compileTestSources(PathConfig pcfg) {
| loc file <- find(testFolder, "rsc") // all Rascal source files
];

ignored = ["lang::rascal::tests::concrete::Patterns3" // takes too long
ignoredFiles = ["lang::rascal::tests::concrete::Patterns3" // takes too long
];
testModules -= ignored;
testModules -= ignoredFiles;
println("Compiling test modules:");
println(testModules);

Expand All @@ -169,7 +169,7 @@ void compileTestSources(PathConfig pcfg) {
}
println("Compiled <n> test modules");
println("<size(exceptions)> failed to compile: <exceptions>");
if(!isEmpty(ignored)) { println("Ignored: <ignored>"); }
if(!isEmpty(ignoredFiles)) { println("Ignored: <ignoredFiles>"); }
secs = total/1000000000;
println("Time: <secs> seconds");
}
Expand Down
18 changes: 9 additions & 9 deletions src/org/rascalmpl/compiler/GenerateTestSources.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void main(list[str] cmdLineArgs) = generateTestSources(cmdLineArgs);

void main() = main([]);

loc REPO = |file:///Users/paulklint/git/|;
loc GIT_REPO = |file:///Users/paulklint/git/|;

list[str] getRascalModules(loc rootFolder, PathConfig pcfg)
= [ getModuleName(file, pcfg) //replaceAll(file[extension=""].path[1..], "/", "::")
Expand All @@ -66,25 +66,25 @@ void generateTestSources(list[str] cmdLineArgs) {
list[str] modulesToCompile = [];

if("all" in cmdLineArgs){
modulesToCompile = getRascalModules(REPO + "rascal/src/org/rascalmpl/library", pcfg);
modulesToCompile = getRascalModules(GIT_REPO + "rascal/src/org/rascalmpl/library", pcfg);
} else {
testFolders = [ REPO + "rascal/src/org/rascalmpl/library/lang/rascal/tests"
, REPO + "rascal/src/org/rascalmpl/library/lang/rascal/grammar/tests"
, REPO + "rascal/src/org/rascalmpl/library/lang/rascalcore/agrammar/tests"
// , REPO + "rascal/src/org/rascalmpl/compiler/lang/rascalcore/check/tests"
testFolders = [ GIT_REPO + "rascal/src/org/rascalmpl/library/lang/rascal/tests"
, GIT_REPO + "rascal/src/org/rascalmpl/library/lang/rascal/grammar/tests"
, GIT_REPO + "rascal/src/org/rascalmpl/library/lang/rascalcore/agrammar/tests"
// , GIT_REPO + "rascal/src/org/rascalmpl/compiler/lang/rascalcore/check/tests"
];

modulesToCompile = [ *getRascalModules(testFolder, pcfg)
| testFolder <- testFolders
];
}

ignored = ["lang::rascal::tests::concrete::Patterns3",
ignoredFiles = ["lang::rascal::tests::concrete::Patterns3",
"lang::rascal::syntax::tests::ExpressionGrammars",
"lang::sdf2::util::SDF2Grammar",
"lang::sdf2::util::Importer"
];
modulesToCompile -= ignored;
modulesToCompile -= ignoredFiles;

list[str] exceptions = [];
int n = size(modulesToCompile);
Expand All @@ -98,7 +98,7 @@ void generateTestSources(list[str] cmdLineArgs) {
}
println("Compiled <n> modules");
println("<size(exceptions)> failed to compile:"); iprintln(exceptions);
if(!isEmpty(ignored)) { println("Ignored: <ignored>"); }
if(!isEmpty(ignoredFiles)) { println("Ignored: <ignoredFiles>"); }
secs = isEmpty(durations) ? 0 : sum(range(durations))/1000000000;
println("Time: <secs/60> minutes");
//iprintln(sort({ <m, durations[m] / 1000000000> | m <- durations}, bool (<_,int i>, <_, int j>) { return i < j; }));
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 @@ -505,7 +503,7 @@ void reportConstructorOverload(Expression current, overloadedAType(rel[loc def,
ovl1 = coverloads[0];
adtNames = { adtName | <key, idRole, tp> <- overloads, acons(ret:aadt(adtName, list[AType] _, _), list[AType] fields, list[Keyword] kwFields) := tp };
qualifyHint = size(adtNames) > 1 ? " you may use <intercalateOr(sort(adtNames))> as qualifier" : "";
argHint = "<isEmpty(qualifyHint) ? "" : " or ">make argument type(s) more precise";
argHint = "<isEmpty(qualifyHint) ? " " : " or ">make argument type(s) more precise";
msg = error("Constructor `<ovl1.atype.alabel>` is overloaded, maybe<qualifyHint><argHint>",
current@\loc);
s.addMessages([msg]);
Expand All @@ -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;
if(isLogicalLoc(def.defined)) return <true, 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 Expand Up @@ -269,7 +271,7 @@ public RascalCompilerConfig getFlyBytesCompilerConfig(bool keep=true){
// ---- salix -----------------------------------------------------------------

public PathConfig getSalixPathConfig(bool keep = false) {
return makePathConfig([ REPO + "salix-core/src/main/rascal", REPO + "salix-contrib/src/main/rascal" ],
return makePathConfig([ REPO + "salix-core/src/", REPO + "salix-contrib/src/main/rascal" ],
[ RASCAL ],
keep=keep);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ test bool AssignIntModuleVarOk() {
");
}

// @ignore{Test needs typepal version > 0.15.1}
test bool AssignAndIncrementIntModuleVarOk() {
clearMemory();
writeModule("module A public int X = 1;");
Expand Down Expand Up @@ -349,7 +348,28 @@ test bool AssignAndIncrementListIntModuleVarOk() {
");
}

//@ignore{Test needs typepal version > 0.15.1}
test bool doubleDeclarationOfPrivateModuleVarOk(){
clearMemory();
writeModule("module A int X = 1;");
return checkModuleOK("
module B
import A;
int X = 2;
int main() = X;
");
}

test bool doubleDeclarationOfPublicModuleVarNotOk(){
clearMemory();
writeModule("module A public int X = 1;");
return unexpectedDeclarationInModule("
module B
import A;
public int X = 2;
int main() = X;
");
}

test bool InferredVarAndModuleVarOk(){
clearMemory();
return checkModuleOK("
Expand All @@ -362,7 +382,6 @@ test bool InferredVarAndModuleVarOk(){
");
}

// @ignore{Test needs typepal version > 0.15.1}
test bool InferredVarAndImportedModuleVarOk(){
clearMemory();
writeModule("module A public int X = 1;");
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
Loading