-
I am trying to get a comma separated list going, where a trailing comma is allowed:
<1> The final command may be present or not I am using the playground for experimenting with this. Here is the link to my original version: playground link This results in the problem, that it always seems to require a comma, my expectation would be, that if the first section ( If I change the rule of
My expectation would be that it tries either branch, on of them succeeding. However, what I get is a frozen playground, and the following error in the browser console:
Playground link here My expectation would be, if there are errors like this, they get shown to the user and modifying the grammar into an "ok" state, would revive the editor. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @ctron, as for the playground issue: We already have an issue on the langium-website for this. Regarding your grammar:
|
Beta Was this translation helpful? Give feedback.
Hey @ctron,
as for the playground issue: We already have an issue on the langium-website for this.
Regarding your grammar:
( (fields += Field) (',' fields += Field)* | (fields += Field ',')+ )
is ambiguous, since both alternatives start with theField
subrule and the static lookahead isn't long enough to figure out how to disambiguate it. There's an easier way to accomplish your goal: