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

Patch invert if #55

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

Conversation

nbauma109
Copy link
Contributor

@nbauma109 nbauma109 commented Apr 2, 2022

This PR inverts if conditions and statements when line numbers are in the wrong order. The next statements have sometimes inferior line numbers than then statements, making it impossible to debug.

I didn't notice any issue with if/else statements. I noticed the issue only with if statements that return or throw.

As I negate the condition I try to avoid double negation.

Unit tests included.

NOTE; I have a slightly better version of LineNumberVisitor in the other PR with MinMaxLineNumberVisitor.
I deprecated LineNumberVisitor rather than duplicating MinMaxLineNumberVisitor here to avoid a merge conflict of duplicated classes. We can clean this up if we decide to merge this all together.

@nbauma109
Copy link
Contributor Author

Hi @mstrobel
Please help moving forward with this PR
Thanks !

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.

1 participant