charly-lang / charly

🐈 The Charly Programming Language | Written by @KCreate
https://charly-lang.github.io/charly/
MIT License
199 stars 10 forks source link

continue keyword to skip current iteration of loop #131

Closed KCreate closed 7 years ago

KCreate commented 7 years ago

This just skips to the end of the main block of all loops.

The following should print all uneven numbers from 0 to 50

let i = 0
while i < 50 {
  if i % 2 == 0 {
    continue
  }

  print(i)

  i += 1
}

The same should work for until and loop statements.