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

Does return-if from a procedure work as intended #67

Open
JMS-1 opened this issue Oct 15, 2024 · 0 comments
Open

Does return-if from a procedure work as intended #67

JMS-1 opened this issue Oct 15, 2024 · 0 comments

Comments

@JMS-1
Copy link

JMS-1 commented Oct 15, 2024

https://github.com/richorama/IronBlock/blob/master/IronBlock/Blocks/Procedures/ProceduresIfReturn.cs checks the condition and either returns the indicated value or continues execution.

In my understanding this is more or less a no-operation if the return-if is not top-level in the procedure - lets say inside an if (will continue after the if) or even worse inside a loop (may behave a bit like a continue and jump to the next iteration). In either case the return value is lost.

If I'm correct currently I think that fixing this is not completely trivial since in my opinion in true case this block should leave the procedure without any further execution. When I find the time I will do some investigations in Blockly.Net where there is even one more challenge due to the try/catch/finally block - finallies should be executed in full. Could be a mess...

Addition: as far as I understand the code generation will work as expected since it generates a return statement!

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

No branches or pull requests

1 participant