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

coder.lua: omit "goto n+1" from JumpIf #611

Merged
merged 1 commit into from
Jul 9, 2024
Merged

coder.lua: omit "goto n+1" from JumpIf #611

merged 1 commit into from
Jul 9, 2024

Conversation

hugomg
Copy link
Member

@hugomg hugomg commented Jul 9, 2024

De-clutter the generated C code a little bit, by not printing jumps when they jump right into the next block. Minor style tweaks as well.

Comment on lines +521 to 524
ret_stat = "return " .. self:c_var(func.ret_vars[1]) .. ";"
else
ret_stat = "return;"
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ret_stat change doesn't actually change the generated C code, right?
(Or am I understanding it wrong?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this part does not change the generated C code.
(It's just that I don't like if without else)

De-clutter the generated C code a little bit, by not printing jumps
when they jump right into the next block. Minor style tweaks as well.
@hugomg hugomg merged commit 95c67c9 into master Jul 9, 2024
2 checks passed
@hugomg hugomg deleted the pretty-goto branch July 9, 2024 04:10
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