Skip to content
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

Checks for uniqueness of members #2085

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Checks for uniqueness of members #2085

wants to merge 1 commit into from

Conversation

lhstrh
Copy link
Member

@lhstrh lhstrh commented Nov 5, 2023

This is towards addressing #1973.

@@ -139,7 +139,7 @@ public class LFValidator extends BaseLFValidator {

@Check(CheckType.FAST)
public void checkAction(Action action) {
checkName(action.getName(), Literals.VARIABLE__NAME);
checkName(action.getName(), Literals.MEMBER__NAME);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this PR also add checkName calls to other syntactic elements like method, reaction, parameters and state variables? Or am I missing something here about how this code works?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created an interface called Member that is implemented by all of those.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I expected to see a new check checkMember added that actually performs the name check. The way it looks now, we only check names for actions and ports. Or does Xtext automatically take care of checking uniqueness here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uniqueness is checked automatically based on the name attribute. This only specifies which nodes should be checked against one another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants