Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e56974f
Major adaptation to logical ModuleLocations
PaulKlint Jan 5, 2026
2719929
Updated TypePal dependency
PaulKlint Jan 5, 2026
a6d85c4
Fixed two minor errors
PaulKlint Jan 5, 2026
4c797a1
Added (for bootstrapping reasons) a copy of LogicallLocations
PaulKlint Jan 6, 2026
86596ec
Moved contents of LogicalLocation to Location
PaulKlint Jan 6, 2026
d658d26
Forgot to remove old LogicalLocation file
PaulKlint Jan 6, 2026
e35e4e9
Merge branch 'main' into native-logical-locs
PaulKlint Jan 6, 2026
abe0b17
Fixed error in typepal dependency
PaulKlint Jan 6, 2026
c63510b
Exclude target from search
PaulKlint Jan 6, 2026
505d06c
Revert "Exclude target from search"
PaulKlint Jan 6, 2026
39f5f4a
Bumped typepal version
PaulKlint Jan 6, 2026
ecde7f7
Started propagating switch to logical locations to remainder of compiler
PaulKlint Jan 7, 2026
d255f53
Updated TypePal dependency
PaulKlint Jan 7, 2026
074ca0b
Removed duplicate license
PaulKlint Jan 8, 2026
9537179
Fixed error in filterOverloads related to varargs and constructors
PaulKlint Jan 8, 2026
c30d403
Show physical locs in messages
PaulKlint Jan 8, 2026
6b68b80
Fixed type error
PaulKlint Jan 9, 2026
778d915
Removed warnings
PaulKlint Jan 9, 2026
65ab24d
Minor cleanup
PaulKlint Jan 9, 2026
963c98b
Removed warnings
PaulKlint Jan 9, 2026
1674ccf
Started adapting backend
PaulKlint Jan 9, 2026
4d4c849
Optimizing tpl file saving
PaulKlint Jan 9, 2026
8838f1a
Introduced new kinds of logical locations in separate module
PaulKlint Jan 10, 2026
428ffed
Some renamings; undone early changes to backend
PaulKlint Jan 10, 2026
a0282b3
Merge branch 'main' into native-logical-locs
PaulKlint Jan 10, 2026
8cac736
Updated typepal dependency
PaulKlint Jan 14, 2026
fd2c2fc
Explicitly add typepal version number to TModel
PaulKlint Jan 14, 2026
f27c873
Fixes
PaulKlint Jan 14, 2026
78638ce
Removed errors
PaulKlint Jan 14, 2026
94248f3
Fixed various warnings and errors
PaulKlint Jan 14, 2026
04f0ac3
Merge branch 'main' into native-logical-locs
PaulKlint Jan 14, 2026
c9d44a2
Updated typepal dependency
PaulKlint Jan 14, 2026
41c1628
Reimplemented rascalIsAcceptableQualified
PaulKlint Jan 15, 2026
cc260d2
Removed print
PaulKlint Jan 16, 2026
3b4e88c
Updated typepal dependency
PaulKlint Jan 16, 2026
14d5ba0
Removed warnings
PaulKlint Jan 16, 2026
2d49a53
Added missing case
PaulKlint Jan 16, 2026
8085b38
Improved error messages
PaulKlint Jan 20, 2026
e9a58fe
Reduces duplicate messages
PaulKlint Jan 20, 2026
f088142
Bumped typepal version to 0.16.0
PaulKlint Jan 20, 2026
0c300ec
Fixed warning
PaulKlint Jan 20, 2026
f17207f
Added srcs
PaulKlint Jan 20, 2026
9c28e6b
Fixed type errors
PaulKlint Jan 20, 2026
bfa2814
Merge branch 'main' into native-logical-locs
PaulKlint Jan 20, 2026
89e9481
Fixes https://github.com/usethesource/rascal/issues/2600
PaulKlint Jan 21, 2026
430c47c
Added potential missing case in type instantiation
PaulKlint Jan 21, 2026
4d08bd3
Added test for corner case: 0-adic constrcutor of parameterized type,…
PaulKlint Jan 22, 2026
906cd6b
Fixed typo en cleaned comment
PaulKlint Jan 22, 2026
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 @@ -458,7 +458,7 @@
<dependency>
<groupId>org.rascalmpl</groupId>
<artifactId>typepal</artifactId>
<version>0.15.3</version>
<version>0.16.0</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 @@ -165,19 +165,20 @@ list[&T <: node ] unsetRec(list[&T <: node] args) = [unsetRec(a) | a <- args];

bool isManualLayout(AProduction p) = (p has attributes && atag("manual"()) in p.attributes);

tuple[TModel, ModuleStatus] addGrammar(str qualifiedModuleName, set[str] imports, set[str] extends, map[str,TModel] transient_tms, ModuleStatus ms){
tuple[TModel, ModuleStatus] addGrammar(MODID moduleId, set[MODID] imports, set[MODID] extends, map[MODID,TModel] transient_tms, ModuleStatus ms){
try {
rel[AType,AProduction] definedProductions = {};
allStarts = {};
for(m <- {qualifiedModuleName, *imports, *extends}){
qualifiedModuleName = moduleId2moduleName(moduleId);
for(m <- {moduleId, *imports, *extends}){
TModel tm1;
if(transient_tms[m]?){
tm1 = transient_tms[m];
} else {
<found, tm1, ms> = getTModelForModule(m, ms);
if(!found) {
msg = error("Cannot add grammar, tmodel for <m> not found", ms.moduleLocs[qualifiedModuleName] ? |unknown:///|);
ms.messages[qualifiedModuleName] ? {} += { msg };
msg = error("Cannot add grammar, tmodel for <m> not found", ms.moduleLocs[moduleId] ? |unknown:///|);
ms.messages[moduleId] ? {} += { msg };
tm1 = tmodel(modelName=qualifiedModuleName, messages=[msg]);
return <tm1, ms>;
}
Expand Down Expand Up @@ -223,7 +224,7 @@ tuple[TModel, ModuleStatus] addGrammar(str qualifiedModuleName, set[str] imports

// Check keyword rules

tm = checkKeywords(allProductions, transient_tms[qualifiedModuleName]);
tm = checkKeywords(allProductions, transient_tms[moduleId]);

// Check layout

Expand Down
4 changes: 2 additions & 2 deletions src/org/rascalmpl/compiler/lang/rascalcore/check/AType.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ bool asubtype(adt:aadt(str n, list[AType] l, SyntaxRole sr), AType b){
if(isConcreteSyntaxRole(sr)) return asubtype(adt, t);
case avalue():
return true;
case p:aparameter(_, AType bnd):
case p:aparameter(_, _):
return asubtypeRightTypeParam(adt, p);
}
fail;
Expand Down Expand Up @@ -428,7 +428,7 @@ bool asubtype(areified(AType s), AType b){
return true;
case avalue():
return true;
case p: aparameter(_, AType bnd):
case p: aparameter(_, _):
return asubtypeRightTypeParam(s, p);
}
fail;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ public Bindings matchRascalTypeParams0(AType r, AType s, Bindings b) {
if ( isConstructorAType(r) && isADTAType(s) ) {
return matchRascalTypeParams0(getConstructorResultType(r), s, b);
}

if ( isADTAType(r) && isConstructorAType(s) ) {
return matchRascalTypeParams0(r, getConstructorResultType(s), b);
}

// For functions, match the return types and the parameter types
// TODO: kewyword params?
Expand All @@ -204,7 +208,7 @@ public Bindings matchRascalTypeParams0(AType r, AType s, Bindings b) {
}

AType invalidInstantiation(str pname, AType bound, AType actual){
throw invalidInstantiation("Type parameter `<pname>` should be less than `<prettyAType(bound)>`, but is bound to `<prettyAType(actual)>`");
throw invalidInstantiation("Type parameter `&<pname>` should be less than `<prettyAType(deUnique(bound))>`, but is bound to `<prettyAType(deUnique(actual))>`");
}

// NOTE used during match, no bounds check is needed since that is already done during the match
Expand Down Expand Up @@ -235,7 +239,7 @@ AType instantiateRascalTypeParameters(Tree selector, AType t, Bindings bindings,
insert repl;
}
else {
s.report(error(selector, "Type parameter %q should be less than %t, found %t", deUnique(pname), bound, bindings[pname]));
s.report(error(selector, "Type parameter &%q should be less than %t, found %t", deUnique(pname), deUnique(bound), deUnique(bindings[pname])));
}
} else {
insert param;
Expand Down
13 changes: 1 addition & 12 deletions src/org/rascalmpl/compiler/lang/rascalcore/check/ATypeUtils.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
}
@license{
Copyright (c) 2009-2015 CWI
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
}
@contributor{Jurgen J. Vinju - Jurgen.Vinju@cwi.nl - CWI}
@contributor{Mark Hills - Mark.Hills@cwi.nl (CWI)}
@contributor{Paul Klint - Paul.Klint@cwi.nl (CWI)}
@contributor{Anastasia Izmaylova - Anastasia.Izmaylova@cwi.nl (CWI)}
@bootstrapParser
module lang::rascalcore::check::ATypeUtils

Expand Down Expand Up @@ -366,7 +355,7 @@ AType symbol2atype1(Symbol::\cons(Symbol \adt, str name, list[Symbol] parameters
AType symbol2atype1(Symbol::sort(str name)) = aadt(name, [], contextFreeSyntax());
AType symbol2atype1(Symbol::lex(str name)) = aadt(name, [], lexicalSyntax());
AType symbol2atype1(Symbol::keywords(str name)) = aadt(name, [], keywordSyntax());
AType symbol2atype1(Symbol::layouts(str name)) = AType::layouts(name);
AType symbol2atype1(Symbol::layouts(str name)) = aadt(name, [], layoutSyntax());

AType symbol2atype1(Symbol::\parameterized-sort(str name, list[Symbol] parameters)) =
aadt(name, symbol2atype(parameters), contextFreeSyntax());
Expand Down
Loading
Loading