Allow 'continue' statements in 'foreach' loops.

This commit is contained in:
Matt Pharr
2011-12-03 09:31:02 -08:00
parent c3b55de1ad
commit a1c0b4f95a
17 changed files with 359 additions and 40 deletions

View File

@@ -1962,6 +1962,14 @@ of iteration dimensions may be specified, with each one spanning a
different range of values. Within the ``foreach`` loop, the given
identifiers are available as ``const varying int32`` variables.
It is illegal to have a ``break`` statement or a ``return`` statement
within a ``foreach`` loop; a compile-time error will be issued in this
case. (It is legal to have a ``break`` in a regular ``for`` loop that's
nested inside a ``foreach`` loop.) ``continue`` statements are legal in
``foreach`` loops; they have the same effect as in regular ``for`` loops:
a program instances that executes a ``continue`` statement effectively
skips over the rest of the loop body for the current iteration.
As a specific example, consdier the following ``foreach`` statement:
::