Skip to content

Commit

Permalink
Fixed 2 errors: in nested iteration check and in asubtype
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKlint committed May 13, 2024
1 parent 7cd62d5 commit bc85fde
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
9 changes: 7 additions & 2 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources2">
<classpathentry excluding="test-annotations/|target/generated-test-sources/test-annotations/" kind="src" output="target/classes2" path="target/generated-test-sources">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes2" path="target/generated-test-sources2">
<attributes>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="test" value="true"/>
Expand Down Expand Up @@ -42,7 +47,7 @@
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<classpathentry kind="src" output="target/classes2" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ bool asubtype(adt:aadt(str n, list[AType] l, SyntaxRole sr), AType b){
case aadt(n, list[AType] r, _):
return asubtypeList(l, r);
case aadt("Tree", _, _):
/*if(isConcreteSyntaxRole(sr))*/ return true;
if(isConcreteSyntaxRole(sr)) return true;
case \start(AType t):
if(isConcreteSyntaxRole(sr)) return asubtype(adt, t);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1425,11 +1425,6 @@ bool isIterType(AType::\iter-star-seps(_,_)) = true;
bool isIterType(AType::\opt(_)) = true;
default bool isIterType(AType _) = false;

bool isIterStarType(aparameter(_,AType tvb)) = isIterStarType(tvb);
bool isIterStarType(AType::\iter-star(_)) = true;
bool isIterStarType(AType::\iter-star-seps(_,_)) = true;
default bool isIterStarType(AType _) = false;

AType getIterElementType(aparameter(_,AType tvb)) = getIterElementType(tvb);
AType getIterElementType(AType::\iter(AType i)) = i;
AType getIterElementType(AType::\iter-star(AType i)) = i;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,10 @@ bool isIterSym((Sym) `{ <Sym symbol> <Sym sep> }+`) = true;
bool isIterSym((Sym) `{ <Sym symbol> <Sym sep> }*`) = true;
default bool isIterSym(Sym sym) = false;

bool isIterStarSym((Sym) `<Sym symbol>*`) = true;
bool isIterStarSym((Sym) `{ <Sym symbol> <Sym sep> }*`) = true;
default bool isIterStarSym(Sym sym) = false;


bool isLexicalContext(Collector c){
adtStack = c.getStack(currentAdt);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module lang::rascalcore::compile::Examples::Tst6

value main() = 1;
data Content
= content(str id, str title=id)
;

0 comments on commit bc85fde

Please sign in to comment.