From b2e3e5612c31a726663eef9adf439eded32fe613 Mon Sep 17 00:00:00 2001 From: Davy Landman Date: Fri, 27 Oct 2023 13:23:01 +0200 Subject: [PATCH] Remove conditionals from the symbol when making the hole for concrete syntax (#1878) This fixes #1877 which unearthed that the symbolAST2SymbolConstructor behaved differently --- .../library/lang/rascal/grammar/ConcreteSyntax.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/rascalmpl/library/lang/rascal/grammar/ConcreteSyntax.rsc b/src/org/rascalmpl/library/lang/rascal/grammar/ConcreteSyntax.rsc index 20590713c5a..228a5693cf8 100644 --- a/src/org/rascalmpl/library/lang/rascal/grammar/ConcreteSyntax.rsc +++ b/src/org/rascalmpl/library/lang/rascal/grammar/ConcreteSyntax.rsc @@ -39,7 +39,7 @@ public set[Production] holes(Grammar object) { return { regular(iter(\char-class([range(48,57)]))), prod(label("$MetaHole",getTargetSymbol(nont)), [ \char-class([range(0,0)]), - lit(""),lit(":"),iter(\char-class([range(48,57)])), + lit(""),lit(":"),iter(\char-class([range(48,57)])), \char-class([range(0,0)]) ],{Attr::\tag("holeType"(nont))}) // TODO: added qualifier to help compiler | Symbol nont <- object.rules, quotable(nont) @@ -64,6 +64,10 @@ private Symbol denormalize(Symbol s) = visit (s) { case \seq(ss) => seq([t | t <- ss, !(t is layouts)]) }; +private Symbol removeConditionals(Symbol sym) = visit(sym) { + case conditional(s, _) => s +}; + @synopsis{This is needed such that list variables can be repeatedly used as elements of the same list} private Symbol getTargetSymbol(Symbol sym) { switch(sym) {