-
Notifications
You must be signed in to change notification settings - Fork 341
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
chore(gnolang): revamp switch fallthrough #586
Conversation
Found out there's an other `TODO CHALLENGE switch fallthrough` in pre-process, which makes me realize the proper way of dealing with jump statements like fallthrough. In the [initial version][1], a new attribute `ATTR_SWITCH_CLAUSE_IDX` was introduced to store the clause index, but it appears this kind of thing should be handled in the pre-process step. As a result the attribute is removed and replaced with some code in the pre-process step, that stores the clause index in node.BodyIndex, only in case we're dealing with a fallthrough. The tests remain unchanged, which proves this still works as expected. [1]: gnolang#504
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you write a unit test to verify that the change to the codebase is working as expected and providing the desired outcome?
The tests I relied on for this change were written in the previous PR #504, they use the |
Ideally, a test should be conducted to demonstrate the change, such as something that was not functioning properly before. If no new tests can be found, let's use the existing ones. |
Well, the change doesn't add, remove or fix anything. It's just an other way of dealing with Maybe I should have prefix the change with |
Description
Found out there's an other
TODO CHALLENGE switch fallthrough
in pre-process, which makes me realize the proper way of dealing with jump statements like fallthrough.In the initial version, a new attribute
ATTR_SWITCH_CLAUSE_IDX
was introduced to store the clause index, but it appears this kind of thing should be handled in the pre-process step.As a result the attribute is removed and replaced with some code in pre-process step, that stores the clause index in node.BodyIndex, only in case we're dealing with a fallthrough.
How has this been tested?
The tests remain unchanged, which proves this still works as expected.