Skip to content

Commit

Permalink
Removed warning
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKlint committed Oct 6, 2024
1 parent 1161176 commit b039aa7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ value measure(){
}
case Declaration d:
if(d is \data || d is \dataAbstract) datadefs += "<d.user>";
case Variant v:
case Variant _:
stats["variant"] ? 0 += 1;
}
stats["nonterminal"] = size(nonterm);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
module lang::rascalcore::compile::Examples::Tst4


import ParseTree;
//import ParseTree;
// If, instead of this import, we use and empty ADT declaration
//data Tree;
// the problem does not manifest itself

data Symbol // <3>
=
\adt(str name, list[Symbol] parameters)
| \cons(Symbol \adt, str name, list[Symbol] parameters)
;
data Tree;

data AType (str alabel = "")
= c(AType adt)
;

data DefInfo
= defType(Tree tree)
= defType(int tree)
| defType(AType atype)
;

Expand All @@ -20,7 +27,7 @@ alias Define = tuple[DefInfo defInfo];
void main() {
set[Define] defines = {};

set[tuple[DefInfo]] xs = {adt
set[value] xs = {adt
| Define cons: <_> <- defines
, AType consAdtType := cons.defInfo.atype.adt
, Define adt: <defType(consAdtType)> <- defines
Expand Down

0 comments on commit b039aa7

Please sign in to comment.