From 9bb397bb076353a66e94980fb8b543a597d693e4 Mon Sep 17 00:00:00 2001 From: "Jurgen J. Vinju" Date: Tue, 20 Oct 2026 10:18:31 +0200 Subject: [PATCH 1/2] added failing test from issue #2938 --- .../lang/rascal/tests/concrete/Issue2938.rsc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/org/rascalmpl/library/lang/rascal/tests/concrete/Issue2938.rsc diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/Issue2938.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/Issue2938.rsc new file mode 100644 index 00000000000..6f1218ec56b --- /dev/null +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/Issue2938.rsc @@ -0,0 +1,15 @@ +module lang::rascal::tests::concrete::Issue2938 + +import ParseTree; + +layout L = [\ ]* !>> [\ ]; + +syntax Expr = id: [a-z]+ !>> [a-z] | paren: "(" Expr ")"; + +syntax L1 = {Expr ","}+; + +syntax L2 = "[" {Expr!paren ","}+ "]"; + +start syntax S = L1 | L2; + +test bool tryParser() = Expr _ := parse(#Expr, "(a)"); \ No newline at end of file From d48cf071cea28dd89fe8fa8f61f2ab97c2cbb4a7 Mon Sep 17 00:00:00 2001 From: "Jurgen J. Vinju" Date: Tue, 20 Oct 2026 19:53:48 +0200 Subject: [PATCH 2/2] Fixes #2938 Instead of making all regular symbols with different conditions the same, as planned, we made all names for symbols with different conditions different. The reason is that these variables are being used from different contexts, exactly where they need to remain different. --- .../rascalmpl/library/lang/rascal/grammar/ParserGenerator.rsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/rascalmpl/library/lang/rascal/grammar/ParserGenerator.rsc b/src/org/rascalmpl/library/lang/rascal/grammar/ParserGenerator.rsc index c8d7e5dc05f..86c31be56a3 100644 --- a/src/org/rascalmpl/library/lang/rascal/grammar/ParserGenerator.rsc +++ b/src/org/rascalmpl/library/lang/rascal/grammar/ParserGenerator.rsc @@ -672,7 +672,7 @@ default str v2i(value v) { case \item(p:prod(Symbol u,_,_), int i) : return "._"; case \label(str _x, Symbol u) : return v2i(u); case \layouts(str _) : return "$anylayout$"; - case \conditional(Symbol s,_) : return v2i(s); + case \conditional(Symbol s, set[Condition] cs) : return "_"; case \alt(set[Symbol] alts) : return "alt__<}>"[..-1]; case \iter-seps(Symbol s, [_]) : return "_iter_seps_"; case \iter-star-seps(Symbol s, [Symbol sep]) : return "_iter_star_seps__";