Continue 语句

continue 语句会使循环结构进行下一次迭代,其只允许在循环中使用。continue 语句是嵌套 block 的语法糖:

  1. while expr1:
  2. stmt1
  3. continue
  4. stmt2

等价于:

  1. while expr1:
  2. block myBlockName:
  3. stmt1
  4. break myBlockName
  5. stmt2