Skip to content

Checks for uniqueness of members#2085

Draft
lhstrh wants to merge 1 commit intomasterfrom
uniqueness
Draft

Checks for uniqueness of members#2085
lhstrh wants to merge 1 commit intomasterfrom
uniqueness

Conversation

@lhstrh
Copy link
Member

@lhstrh lhstrh commented Nov 5, 2023

This is towards addressing #1973.

@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