-
Notifications
You must be signed in to change notification settings - Fork 85
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
Wrong indentation with single-line case statements #51
Comments
Its because the begin and end are on the same line. Is there any reason you are writing the case statement in this style? The begin and end's are redundant. |
Yes, it actually makes register mapping a bit more readable. Another type of issue arises when I skip begin and end: case (XfrState)
One_XFR : XfrState_str = "One";
Two_XFR : XfrState_str = "Two";
End_XFR : XfrState_str = "End";
default : XfrState_str = "N/A";
endcase is formatted : case (XfrState)
One_XFR : XfrState_str = "One";
Two_XFR : XfrState_str = "Two";
End_XFR : XfrState_str = "End";
default : XfrState_str = "N/A";
endcase or, within a process: always @(XfrState)
case (XfrState)
One_XFR : XfrState_str = "One";
Two_XFR : XfrState_str = "Two";
End_XFR : XfrState_str = "End";
default : XfrState_str = "N/A";
endcase
end |
I'm still not convinced about the The other issue on the other hand was a different problem because the script wasn't reliably case-sensitive. I've just pushed a fix. Thanks for raising this. |
I don't mind adapting the code. Thanks for looking into it. |
@lewis6991 I am unable to replicate the second situation in my current master branch. You did not include the case-sensitive fix in the PR, correct? |
That is correct. |
The reason you cannot replicate is because you probably don't have Having this set changes the behaviour of the plugin. My commit for this was to change this option and restore it at the end of indenting. |
Understood. Let me think about this for some a day or two. |
The only other solution I can think of is to have |
That's not the problem. Try the exact same test case as above, but replace We need to filter out strings. Maybe by doing something like we're doing for comments: we just strip them out from the input before parsing? |
Just submitted some more changes. Please check them. Could you take a look at the |
Stripping out strings may be the best solution. I'm just a little worried about performance. |
Feel free to assign to me. I'll check it out when I get some time. |
I was trying to!!! For some reason you don't appear in the list! |
Is it because it is your personal repo and not an organisation? |
Let me try this: @lewis6991 |
Dumb me: https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/ "You can only create assignments for yourself, collaborators on personal projects, or members of your organization with read permissions on the repository." |
Fixed in 7d83a3e |
Nice! Thanks. |
Hope you don't mind me making commits like this without PR'ing them. |
I don't mind, but I don't think that's the best workflow. Now that I have a collaborator I'm considering starting to PR my own commits, giving us the opportunity to review and discuss the changes before submitting. Hopefully, this will result in better and more feature complete code. |
I agree. I only pushed the commits today as I felt they were fairly trivial and small. I'll put future ones in a PR. |
Will do the same. |
In the following situation:
the automatic indenting gives the result below:
The text was updated successfully, but these errors were encountered: