Skip to content

Commit b949554

Browse files
authored
Merge branch 'main' into cleanup-subtype-for-prods
2 parents f9da9ef + ef4d68c commit b949554

72 files changed

Lines changed: 911 additions & 788 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/build.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
jobs:
1717
test-linux:
1818
if: ${{ !(github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, '[maven-release-plugin]')) }}
19-
runs-on: buildjet-4vcpu-ubuntu-2204
19+
runs-on: ubicloud-standard-4
2020
steps:
2121
- uses: actions/checkout@v4
2222

@@ -53,7 +53,7 @@ jobs:
5353
needs: [test-linux]
5454
permissions:
5555
contents: write
56-
runs-on: buildjet-4vcpu-ubuntu-2204
56+
runs-on: ubicloud-standard-4
5757
environment: ${{ startsWith(github.ref, 'refs/tags/v') && 'deployment' || '' }}
5858
steps:
5959
- uses: browser-actions/setup-chrome@latest
@@ -88,7 +88,7 @@ jobs:
8888

8989
- name: Test if release # just to be extra sure for a release
9090
if: startsWith(github.ref, 'refs/tags/v')
91-
run: mvn -Drascal.test.memory=10 -Drascal.compile.skip -Drascal.tutor.skip test
91+
run: mvn -Drascal.test.memory=14 -Drascal.compile.skip -Drascal.tutor.skip test
9292

9393
- name: Attach artifact
9494
id: build-artifact
@@ -191,7 +191,7 @@ jobs:
191191
compiler-tests:
192192
if: ${{ !(github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, '[maven-release-plugin]')) }}
193193
needs: [test-linux]
194-
runs-on: buildjet-4vcpu-ubuntu-2204
194+
runs-on: ubicloud-standard-4
195195
env:
196196
MAVEN_OPTS: "-Xmx512M -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
197197
steps:

‎pom.xml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>org.rascalmpl</groupId>
55
<artifactId>rascal</artifactId>
6-
<version>0.42.0-RC2-SNAPSHOT</version>
6+
<version>0.42.2-RC2-SNAPSHOT</version>
77
<packaging>jar</packaging>
88

99
<scm>
@@ -28,7 +28,7 @@
2828

2929
<properties>
3030
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
31-
<maven-version>3.9.11</maven-version>
31+
<maven-version>3.9.12</maven-version>
3232
<exec.mainClass>org.rascalmpl.shell.RascalShell</exec.mainClass>
3333
<rascal.test.memory>3</rascal.test.memory>
3434
<maven.compiler.release>11</maven.compiler.release>
@@ -131,7 +131,7 @@
131131
<artifactId>rascal-maven-plugin</artifactId>
132132
<version>${rascal-maven.version}</version>
133133
<configuration>
134-
<bootstrapRascalVersion>0.42.0-RC1</bootstrapRascalVersion>
134+
<bootstrapRascalVersion>0.42.0</bootstrapRascalVersion>
135135
<parallel>true</parallel>
136136
<parallelPreChecks>
137137
<pre>${project.basedir}/src/org/rascalmpl/library/Prelude.rsc</pre>
@@ -458,7 +458,7 @@
458458
<dependency>
459459
<groupId>org.rascalmpl</groupId>
460460
<artifactId>typepal</artifactId>
461-
<version>0.16.4</version>
461+
<version>0.16.6-RC2</version>
462462
<!-- <scope>provided</scope> for shade plugin it can't be provided. At least the rascal dependency in typepal should be provided -->
463463
<scope>compile</scope>
464464
</dependency>

‎src/org/rascalmpl/compiler/CheckTestSources.rsc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import util::FileSystem;
3636
import util::Benchmark;
3737
import lang::rascalcore::compile::util::Names;
3838
import lang::rascalcore::check::RascalConfig;
39+
import lang::rascalcore::check::TestConfigs;
3940

4041

4142
void main() = checkTestSources([]);

‎src/org/rascalmpl/compiler/CompileTestSources.rsc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import lang::rascalcore::compile::Compile;
4040
import util::FileSystem;
4141
import util::Benchmark;
4242
import lang::rascalcore::compile::util::Names;
43+
import lang::rascalcore::check::TestConfigs;
4344

4445
loc GIT_REPO = |file:///Users/paulklint/git/|;
4546

‎src/org/rascalmpl/compiler/GenerateTestSources.rsc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import util::Monitor;
3838
import util::Benchmark;
3939
import lang::rascalcore::compile::util::Names;
4040
import util::SystemAPI;
41+
import lang::rascalcore::check::TestConfigs;
4142

4243
// if cmdLineArgs contains "all", then all files in the rascal project are used (~400 files)
4344
// otherwise only standard library and test files (~200 files)

‎src/org/rascalmpl/compiler/lang/rascalcore/check/ADTandGrammar.rsc‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ list[&T <: node ] unsetRec(list[&T <: node] args) = [unsetRec(a) | a <- args];
165165
166166
bool isManualLayout(AProduction p) = (p has attributes && atag("manual"()) in p.attributes);
167167
168-
tuple[TModel, ModuleStatus] addGrammar(MODID moduleId, set[MODID] imports, set[MODID] extends, map[MODID,TModel] transient_tms, ModuleStatus ms){
168+
tuple[bool, TModel, ModuleStatus] addGrammar(MODID moduleId, set[MODID] imports, set[MODID] extends, map[MODID,TModel] transient_tms, ModuleStatus ms){
169169
try {
170170
rel[AType,AProduction] definedProductions = {};
171171
allStarts = {};
@@ -177,10 +177,11 @@ tuple[TModel, ModuleStatus] addGrammar(MODID moduleId, set[MODID] imports, set[M
177177
} else {
178178
<found, tm1, ms> = getTModelForModule(m, ms);
179179
if(!found) {
180-
msg = error("Cannot add grammar, tmodel for <m> not found", ms.moduleLocs[moduleId] ? |unknown:///|);
180+
msg = error("Cannot add grammar or tmodel since `<moduleId2moduleName(m)>` is not found", ms.moduleLocs[moduleId] ? |unknown:///|);
181+
//println(msg); // TODO: Just to record this event; this should probably go to a log file
181182
ms.messages[moduleId] ? {} += { msg };
182183
tm1 = tmodel(modelName=qualifiedModuleName, messages=[msg]);
183-
return <tm1, ms>;
184+
return <false, tm1, ms>;
184185
}
185186
}
186187
facts = tm1.facts;
@@ -317,10 +318,10 @@ tuple[TModel, ModuleStatus] addGrammar(MODID moduleId, set[MODID] imports, set[M
317318
tm = tmlayouts(tm, definedLayout, allManualLayouts);
318319
//println("ADTandGrammar:"); iprintln(g, lineLimit=10000);
319320
tm.store[key_grammar] = [g];
320-
return <tm, ms>;
321+
return <true, tm, ms>;
321322
} catch TypeUnavailable(): {
322323
// protect against undefined entities in the grammar that have not yet been reported.
323-
return <tmodel(), ms>;
324+
return <false, tmodel(), ms>;
324325
}
325326
}
326327

‎src/org/rascalmpl/compiler/lang/rascalcore/check/ATypeInstantiation.rsc‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,13 @@ AType instantiateRascalTypeParameters(Tree selector, AType t, Bindings bindings,
233233
return t;
234234
else
235235
return visit(t) { case param:aparameter(str pname, AType bound): {
236-
if(bindings[pname]?){
237-
if(asubtype(bindings[pname], bound)){
238-
repl = param.alabel? ? bindings[pname][alabel=param.alabel] : bindings[pname]; //TODO simplified for compiler
239-
insert repl;
240-
}
241-
else {
242-
s.report(error(selector, "Type parameter &%q should be less than %t, found %t", deUnique(pname), deUnique(bound), deUnique(bindings[pname])));
236+
if(pname in bindings){
237+
ult = bindings[pname];
238+
if(asubtype(ult, bound)){
239+
insert param.alabel? ? ult[alabel=param.alabel] : ult;
240+
} else {
241+
s.report(error(selector, "Type parameter &%q should be less than %t, found %t", deUnique(pname), deUnique(bound), deUnique(ult)));
243242
}
244-
} else {
245-
insert param;
246243
}
247244
}
248245
};

0 commit comments

Comments
 (0)