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

Rule to remove superfluous brackets #617

Open
imd1 opened this issue Oct 6, 2021 · 4 comments
Open

Rule to remove superfluous brackets #617

imd1 opened this issue Oct 6, 2021 · 4 comments
Assignees

Comments

@imd1
Copy link
Contributor

imd1 commented Oct 6, 2021

For example, the brackets in the following snippet are superfluous, could there be a rule to remove them?

      if (sync_reset) = '1' then
@jeremiah-c-leary
Copy link
Owner

If we could determine which ones are superfluous....

   if (a = '1') and (b = '0') then

those are extra, but...

   if (a = '1' and b = '0') and (c = '0' or d = '1') then

...those are not.

we would need to figure out the rules.

@imd1
Copy link
Contributor Author

imd1 commented Oct 7, 2021

I think that my example is an obvious case, but your examples are less so, in the sense that the brackets do provide a documentation grouping benefit and some people prefer that explicit style

@jeremiah-c-leary jeremiah-c-leary added this to User Feedback in Issue Triage Oct 22, 2021
@imd1
Copy link
Contributor Author

imd1 commented Dec 31, 2021

This ticket is incorrectly assigned as User Feedback?

@jeremiah-c-leary jeremiah-c-leary removed this from User Feedback in Issue Triage Feb 1, 2022
@jeremiah-c-leary jeremiah-c-leary self-assigned this Feb 1, 2022
@jeremiah-c-leary
Copy link
Owner

Hey @imd1,

We should pick this back up.

I was thinking that you could use logical operators to determine which parenthesis are superfluous.
In my previous example:

    if (a = '1' and b = '0') and (c = '0' or d = '1') then

The parenthesis are not superflous because of the logic operator. This would probably be true of logic operators also.

Is the rule simply a single word enclosed by parenthesis? Like in your example?

We could always start the rule out at that level and then add to it as we need to.

--Jeremy

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

No branches or pull requests

2 participants