Closed wildarch closed 2 years ago
In Spoofax 3 0.16.13 I can reproduce the issues with the ambiguity warnings, but on top of those warnings, I also get parse errors. I'm going ask @Gohla to have a look at this, since I don't expect those ambiguity warnings either when there are parse errors that are the problem.
@Apanatshka I debugged this and this is just what JSGLR2 provides as output. It parses and recovers successfully, produces a number of errors, but there are also several ambiguities in the AST that are reported as warnings. There's not much I can do other than filter out ambiguities when parsing fails or recovers, but I'm not sure I should do that in general.
Describe the bug Syntactically invalid stratego rule definitions can lead to an ambiguous parse.
Project In the editor when using Stratego 2.
Versions Spoofax 3 0.16.3
To Reproduce I found two small snippets that produce an ambiguous parse. Both can be pasted into
main.str2
on a new clean project to trigger the bug.Adding a colon after
rules
Omitting the
where
keywordObserved behaviour
Expected behaviour A syntax error.
Ideally for any ambiguous parse, it would be good to explain in the warning that the ambiguity is in the internal Stratego syntax definition, not in the stratego rule written by the user (so not their fault).
Additional context N/A