-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implement Control Flow #152
Comments
I did some thinking about this yesterday. https://github.com/Ratstail91/Toy/blob/v2/.notes/control-flow-opcodes.txt |
The control flow for break and continue requires arrays to keep track during compilation, so #155 needs to be finished first. Addendum: Turns out that wasn't the case. A bespoke "escape" structure was all that was needed. |
For break/continue keywords:
Therefore, the following structure is needed:
Could wrap this in a reallocate function too, similar to |
There were a couple bugs - I'm glad I'm so thorough with these tests. See #152
foreach isn't needed yet, and will apply to arrays and tables directly. Will add later. do-while is rarely used, and switch isn'5 even thought out. for might be easy, but I might start on something else, like functions, instead. |
if-then-else?:
whilecontinuebreakI'm not sure how a switch statement could be done efficiently, so it'll need research.
The text was updated successfully, but these errors were encountered: