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

Add continue statement #822

Merged
merged 6 commits into from
Dec 3, 2020
Merged

Conversation

GlaireDaggers
Copy link
Contributor

  • Adds a new continue token & statement. A continue statement immediately skips to the next iteration of a loop by jumping back to loop top.
  • Added tests for the continue statement.

@mhermier
Copy link
Contributor

mhermier commented Oct 8, 2020 via email

@ruby0x1
Copy link
Member

ruby0x1 commented Oct 8, 2020

Thanks @KillaMaaki I'll look closer soon.

It's fine without refactoring since we're going to squash it into one commit anyway, it's a single feature.

@KillaMaaki If you had already explored do while, you're welcome to make a PR so we can see the scope of the change.

Thanks for the PR!

@avivbeeri
Copy link
Contributor

This PR seems fine, tests all pass. Needs documentation though:

  • Mention continue in the syntax->reserved words section
  • Add a section for continue on the Control Flow page

@ChayimFriedman2
Copy link
Contributor

ChayimFriedman2 commented Nov 1, 2020

I've never felt the need in continue.

@avivbeeri
Copy link
Contributor

The presence of continue was previously discussed, and requested in here: #817

@ruby0x1 ruby0x1 merged commit 55b9264 into wren-lang:main Dec 3, 2020
@ruby0x1
Copy link
Member

ruby0x1 commented Dec 3, 2020

I've been testing this in my engine for a while and haven't seen any issues or surprises, and is great to have.

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.

5 participants