Community
Participate
Working Groups
Defined fragments cannot be used in rules that make use of the "and" operator. While in the following example rule A works without any issues, B throws an "Unassigned rule calls may not be used in unordered groups" error. Super: A | B; fragment frag returns Super: name = ID; A: frag | something = ID; B: frag & something = ID;
Created attachment 264069 [details] Reproducing Project The check would need to detect that 'frag' is actually a fragment call and that the assignment is assured within the fragment.
Hi, I'm reviving this old bug report because I'd like to try to fix this issue. I'm quite new to Xtext but I feel that with a little guidance I could succeed. In his comment, Karsten wrote: "The check would need to detect that 'frag' is actually a fragment call and that the assignment is assured within the fragment.". A quick glance at the code in XtextValidator.java makes me think that implementing the first check (checking that the rule is a fragment) is trivial, but I'm not quite sure how, exactly, to ensure that the assignment takes place within the fragment. My first hypothesis is that I need to check that the fragment rule only contains assigned rule calls and nothing else - is this correct? What else should I check? Thanks.
Tommaso, we moved to GitHub Issues, so as a first step, you could open a new issue https://github.com/eclipse/xtext/issues mentioning this bug, possibly with some background. If you haven't done so, you can use Oomph to have a workspace to work/experiment on Xtext code base: https://github.com/eclipse/xtext/blob/main/CONTRIBUTING.md