Skip to content

Commit b2e3e56

Browse files
authored
Remove conditionals from the symbol when making the hole for concrete syntax (#1878)
This fixes #1877 which unearthed that the symbolAST2SymbolConstructor behaved differently
1 parent b684d0e commit b2e3e56

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/org/rascalmpl/library/lang/rascal/grammar/ConcreteSyntax.rsc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public set[Production] holes(Grammar object) {
3939
return { regular(iter(\char-class([range(48,57)]))),
4040
prod(label("$MetaHole",getTargetSymbol(nont)),
4141
[ \char-class([range(0,0)]),
42-
lit("<denormalize(nont)>"),lit(":"),iter(\char-class([range(48,57)])),
42+
lit("<removeConditionals(denormalize(nont))>"),lit(":"),iter(\char-class([range(48,57)])),
4343
\char-class([range(0,0)])
4444
],{Attr::\tag("holeType"(nont))}) // TODO: added qualifier to help compiler
4545
| Symbol nont <- object.rules, quotable(nont)
@@ -64,6 +64,10 @@ private Symbol denormalize(Symbol s) = visit (s) {
6464
case \seq(ss) => seq([t | t <- ss, !(t is layouts)])
6565
};
6666

67+
private Symbol removeConditionals(Symbol sym) = visit(sym) {
68+
case conditional(s, _) => s
69+
};
70+
6771
@synopsis{This is needed such that list variables can be repeatedly used as elements of the same list}
6872
private Symbol getTargetSymbol(Symbol sym) {
6973
switch(sym) {

0 commit comments

Comments
 (0)