Skip to content

Commit

Permalink
Fixed selection of "src" on a Tree value
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKlint committed Jun 27, 2024
1 parent 1aaad41 commit 8513d29
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
17 changes: 15 additions & 2 deletions src/org/rascalmpl/core/library/B.rsc
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
module B

extend A;

syntax B = A+;
import ParseTree;

//syntax B = 'b';
//
//void X(B t) {
// if (t.src != |unkown:///|) { // gaat goed
// throw "";
// }
//}

void X(Tree t2) {
if (t2.src != |unkown:///|) { // error
throw "";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,22 @@ AType rascalGetTypeInTypeFromDefine(Define containerDef, str selectorName, set[I
//println("rascalGetTypeInTypeFromDefine: <containerDef>, <selectorName>");
//println("commonKeywordFields: <containerDef.defInfo.commonKeywordFields>");
containerType = s.getType(containerDef.defined);
if(fieldId() in idRolesSel && selectorName == "top" && isStartNonTerminalType(containerType)){
if( fieldId() in idRolesSel
&& selectorName == "top"
&& isStartNonTerminalType(containerType)
){
return getStartNonTerminalType(containerType);
}
if(fieldId() in idRolesSel && selectorName == "top" && isTreeType(containerType)){
if( fieldId() in idRolesSel
&& selectorName == "top"
&& isTreeType(containerType)
){
return containerType;
}
if(keywordFieldId() in idRolesSel && selectorName == "src" && isNonTerminalAType(containerType)){
if( keywordFieldId() in idRolesSel
&& selectorName == "src"
&& (isTreeType(containerType) || isNonTerminalAType(containerType))
){
return aloc();
}

Expand Down

0 comments on commit 8513d29

Please sign in to comment.