diff --git a/src/org/rascalmpl/compiler/lang/rascalcore/check/ATypeUtils.rsc b/src/org/rascalmpl/compiler/lang/rascalcore/check/ATypeUtils.rsc index 4243ece11c..697640d234 100644 --- a/src/org/rascalmpl/compiler/lang/rascalcore/check/ATypeUtils.rsc +++ b/src/org/rascalmpl/compiler/lang/rascalcore/check/ATypeUtils.rsc @@ -71,6 +71,7 @@ str prettyAType(avalue()) = "value"; str prettyAType(aloc()) = "loc"; str prettyAType(adatetime()) = "datetime"; str prettyAType(alist(AType t)) = "list[]"; +str prettyAType(abag(AType t)) = "bag[]"; str prettyAType(aset(AType t)) = "set[]"; str prettyAType(atuple(AType ts)) = "tuple[]"; str prettyAType(amap(AType d, AType r)) = "map[, ]"; @@ -92,6 +93,7 @@ str prettyAType(t: acons(AType adt, /*str consName,*/ list[AType] fields, list[Keyword] kwFields)) = "::(" : "">" | ft <- fields])> =..." | Keyword kw <- kwFields])>)"; +str prettyAType(aprod(AProduction production)) = prettyAType(production); str prettyAType(amodule(str mname)) = "module "; str prettyAType(aparameter(str pn, AType t, closed=c)) = @@ -108,7 +110,12 @@ str prettyAType(Keyword kw: kwField(fieldType, fieldName, _,defaultExp)) = "
)"; //TODO others
+str prettyAType(\prod(AType s, list[AType] fs/*, SyntaxRole _*/)) = " : ";
+str prettyAType(regular(AType s)) = prettyAType(s);
+str prettyAType(priority(AType _s, list[AProduction] choices)) = " ", [ prettyAType(a) | a <- choices ])>";
+str prettyAType(associativity(AType _s, AAssociativity \assoc, set[AProduction] alternatives)) = " (  )";
+str prettyAType(reference(AType s, str cons)) = ":";
+str prettyAType(\achoice(AType s, set[AProduction] alternatives)) = "";
 
 // terminal symbols
 str prettyAType(alit(str string)) = string;
@@ -124,9 +131,9 @@ str prettyAType(\aempty()) = "()";
 str prettyAType(\opt(AType symbol)) = "?";
 str prettyAType(\iter(AType symbol)) = "+";
 str prettyAType(\iter-star(AType symbol)) = "*";
-str prettyAType(\iter-seps(AType symbol, list[AType] separators)) = "{ \"" | sep <- separators, !isLayoutAType(sep) ])>}+";
-str prettyAType(\iter-star-seps(AType symbol, list[AType] separators)) = "{ \"" | sep <- separators, !isLayoutAType(sep) ])>}*";
-str prettyAType(\alt(set[AType] alternatives)) = "(  )" when size(alternatives) > 1;
+str prettyAType(\iter-seps(AType symbol, list[AType] separators)) = size(seps) == 0 ? prettyAType(iter(symbol)) : "{ }+" when seps := [ "\"\"" | sep <- separators, !isLayoutAType(sep) ];
+str prettyAType(\iter-star-seps(AType symbol, list[AType] separators)) = size(seps) == 0 ? prettyAType(\iter-star(symbol)) :  "{ }*" when seps := [ "\"\"" | sep <- separators, !isLayoutAType(sep) ];
+str prettyAType(\alt(set[AType] alternatives)) = "(  )" when size(alternatives) > 0;
 str prettyAType(\seq(list[AType] sequence)) = "(  )" when size(sequence) > 1;
 str prettyAType(\conditional(AType symbol, set[ACondition] conditions)) = " {  }";
 default str prettyAType(AType s) = ""; //"";
@@ -141,6 +148,12 @@ private str prettyPrintCond("a-begin-of-line"()) = "^";
 private str prettyPrintCond("a-end-of-line"()) = "$";
 private str prettyPrintCond("a-except"(str label)) = "!