From b039aa710df870b4a05a81bafe782d64a8c79517 Mon Sep 17 00:00:00 2001 From: paulklint Date: Sun, 6 Oct 2024 12:06:27 +0200 Subject: [PATCH] Removed warning --- .../rascalcore/compile/Examples/RascalMetrics.rsc | 2 +- .../lang/rascalcore/compile/Examples/Tst4.rsc | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/RascalMetrics.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/RascalMetrics.rsc index ff54d1ce..913d3950 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/RascalMetrics.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/RascalMetrics.rsc @@ -54,7 +54,7 @@ value measure(){ } case Declaration d: if(d is \data || d is \dataAbstract) datadefs += ""; - case Variant v: + case Variant _: stats["variant"] ? 0 += 1; } stats["nonterminal"] = size(nonterm); diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst4.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst4.rsc index 5f39ca62..e00ad556 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst4.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst4.rsc @@ -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) ; @@ -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: <- defines