-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation for assignments with =
instead of +=
#1412
Validation for assignments with =
instead of +=
#1412
Conversation
Thanks @JohannesMeierSE ! Nice refactoring. No it is going down only and we can concentrate better on the special cases. Especially the one about multiple actions. Is it really a bad thing? Same we actually have for binary operators. Of course you could add some concrete example with two explicit actions and see what happens. Apart from that, just two additional comments :). |
…well, added more test cases
a6ee465
to
5dc9426
Compare
Thanks @Lotes for the second review! Yes, I like the new structure as well! In the end, it was easier than I expected before 🙂 The handling of two or more explicit actions within the same parser rule was already covered, I just forgot to remove my internal hint. The case with a single action with a loop around it was already covered and tested. Additionally, I fixed this issue in another test case in the Langium code base and rebased this branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me :). Thanks.
It is funny, there is a second checkRuleCallMultiplicity
... but it has a different scope, it is not entirely what you are checking. WDYT about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me. Just a few minor improvements, see below.
Thanks @msujew for your review! In my eyes, this feature is ready to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me 👍
This PR adds validations for assignments using the
=
operator, while they got multiple values assigned. This validation gives the user the hint to use+=
as assignment operator instead.Among others, the following details are considered during the validation and complemented with test cases: